MinGW on Windows 10 for C++

时间:2019-06-01 14:16:55

标签: c++ windows powershell

I have installed MinGW64 on Windows 10(under C:\mingw, not C:\Program Files). After adding the directory of the \bin to System Path, I thought I would be able to go to terminal and run g++; however, I get g++ not recognized. I tried in terminal, Powershell, and Git bash(why so many terminals??) and same result for all of them. I am new to Windows so may be missing something very simple here.

My Path is Path=C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\6\;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\wingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\wingw32\bin;C:\Users\Darin\AppData\Local\Microsoft\WindowsApps;C:\Users\Darin\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\CMake\bin;C:\Program Files\Git\bin; PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

The goal is to get g++ working both in and out of Virtual Studio Code. I used this website as my guide. https://code.visualstudio.com/docs/cpp/config-mingw

When I tried under VS Code, I noticed that it is using Powershell, not the Git bash that I thought it would use, and it fails for the same reason on g++ of course. Below is c_cpp_properties.json if that helps.

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE"
            ],
            "windowsSdkVersion": "10.0.17763.0",
            "compilerPath": "C:/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/g++.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "gcc-x64",
            "browse": {
                "path": [
                    "${workspaceFolder}"
                ],
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": ""
            }
        }
    ],
    "version": 4
}

Any assistance is greatly appreciated!

0 个答案:

没有答案