Проблема компилятора vscode c ++: термин «g ++» не распознается - PullRequest
0 голосов
/ 26 октября 2019

Я пытался настроить компилятор для c ++ в vscode, я использовал Mingw-w64, но всегда получаю сообщение об ошибке при попытке запустить простой код helloworld.

Я уже повторил все шаги и не вижу другого результатая думаю, что проблема в пути к g ++, но я не знаю, какой путь мне следует использовать.

свойства json:

{
   "configurations": [
       {
           "name": "Win32",
           "includePath": [
               "${workspaceFolder}/**"
           ],
           "defines": [
               "_DEBUG",
               "UNICODE",
               "_UNICODE"
           ],
           "compilerPath": "C:\\mingw-w64\\mingw64\\bin\\g++.exe",
           "cStandard": "c11",
           "cppStandard": "c++20",
           "intelliSenseMode": "gcc-x64"
       }
   ],
   "version": 4
}

tasks json:

{
    "version": "2.0.0",
    "tasks": [
      {
        "label": "test",
        "type": "shell",
        "command": "g++",
        "args": ["-g", "-o", "test", "test.cpp"],
        "group": {
          "kind": "build",
          "isDefault": true
        }
      }
    ]
  }

Я не ожидаю сообщений об ошибках, но показывает эту ошибку:

 "g++ : The term 'g++' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At line:1 char:1
+ g++ -g -o test test.cpp
+ ~~~
    + CategoryInfo          : ObjectNotFound: (g++:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException"
...