Import MinGW compiler in Visual Studio 2017

て烟熏妆下的殇ゞ 提交于 2021-02-07 09:57:05

问题


Halo to the community,

I have created a WIN32 C++ Solution-project in Visual Studio 2017. I want the files of the WIN32 application to be compiled by the MinGW compiler and then be able to debug the application using Visual Studio 2017.

I am trying to follow this tutorial in order to import the MinGw compiler. I understand that this tutorial is referring to the MinGW-w64 project but I want to import the MinGW compiler found here.

Can you please help me make the right associations in the "CppProperties.json" and the "tasks.vs.json" files?

My "CppProperties.json" at the moment looks like this:

{  "configurations": [
{
  "inheritEnvironments": [
    "msvc_x86"
  ],
  "name": "x86-Debug",
  "includePath": [
    "${env.INCLUDE}"
  ],
  "defines": [
    "WIN32",
    "_DEBUG",
    "UNICODE",
    "_UNICODE"
  ],
  "intelliSenseMode": "windows-clang-x86"
},
{
  "inheritEnvironments": [
    "msvc_x86"
  ],
  "name": "x86-Release",
  "includePath": [
    "${env.INCLUDE}"
  ],
  "defines": [
    "WIN32",
    "NDEBUG",
    "UNICODE",
    "_UNICODE"
  ],
  "intelliSenseMode": "windows-clang-x86"
}
], 
"environments": [
{
  "MINGW_PREFIX": "C:\\MinGW",
  "MINGW_CHOST ": "x86_64-w64-mingw32",
  "MINGW_PACKAGE_PREFIX": "mingw-w64-x86_64",
  "MSYSTEM": "MINGW64",
  "MSYSTEM_CARCH": "x64_64",
  "MSYSTEM_PREFIX": "${env.MINGW_PREFIX}",
  "SHELL": "${env.MINGW_PREFIX}/../usr/bin/bash",
  "TEMP": "${env.MINGW_PREFIX}/../tmp",
  "TMP": "${env.TEMP}",
  "PATH": "${env.MINGW_PREFIX}/bin;${env.MINGW_PREFIX}/../usr/local/bin;${env.MINGW_PREFIX}/../usr/bin;${env.PATH}",
  "INCLUDE": "project/lib/include;${env.MINGW_PREFIX}/mingw/include"
}  
]
}

来源:https://stackoverflow.com/questions/47869582/import-mingw-compiler-in-visual-studio-2017

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!