Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
“如何修复”/bin/bash:[command]未找到命令";在为c+设置tasks.json和c#cpp#u properties.json之后+;在Windows10上VS代码?_Json_Visual Studio Code - Fatal编程技术网

“如何修复”/bin/bash:[command]未找到命令";在为c+设置tasks.json和c#cpp#u properties.json之后+;在Windows10上VS代码?

“如何修复”/bin/bash:[command]未找到命令";在为c+设置tasks.json和c#cpp#u properties.json之后+;在Windows10上VS代码?,json,visual-studio-code,Json,Visual Studio Code,我已经配置了task.json和c_cpp_properties.json,以便编译main.cpp程序。为了继续,我必须按下按钮 Ctrl + Shift + B 一旦我这样做,就会弹出一个终端并更改我的错误: Executing task in folder C++: C:\MinGW\bin\g++.exe -g main.cpp -o c:\Users\Me\Desktop\C++\.vscode\tasks.exe < /bin/bash: C:MinGWbing++.exe

我已经配置了task.json和c_cpp_properties.json,以便编译main.cpp程序。为了继续,我必须按下按钮

Ctrl + Shift + B
一旦我这样做,就会弹出一个终端并更改我的错误:

Executing task in folder C++: C:\MinGW\bin\g++.exe -g main.cpp -o c:\Users\Me\Desktop\C++\.vscode\tasks.exe <

/bin/bash: C:MinGWbing++.exe: command not found
The terminal process terminated with exit code: 127

Terminal will be reused by tasks, press any key to close it.
我也根据这个检查了路径

与我有关的唯一最近的问题是这个链接。我也尝试过使用thread更改下面代码中显示的文件目录,但仍然遇到这个错误

以下是我的.vscode文件中的JSON文件:

tasks.json:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "echo",
      "type": "shell",
      "command": "C:\\MinGW\\bin\\g++.exe",
      "args": [
        "-g",
        "main.cpp",
        "-o",
        "${fileDirname}\\${fileBasenameNoExtension}.exe"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "problemMatcher": []
    }
  ]
}
c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.17134.0",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64/cl.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "msvc-x64",
            "browse": {
                "path": [
                    "${workspaceRoot}",
                    "C:\\MinGW\\lib\\gcc\\mingw32\\8.2.0\\include\\c++"
                ],
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": ""
            }
        }
    ],
    "version": 4
}

我希望在编译后能看到一个“.exe”,但我不能因为错误。

< P>在花了两天的时间之后,我终于能够纠正VS代码上的安装C++并解决错误。p>
根据上面的png图像,我已经在“用户变量为我”对话框下的用户变量“Path”中包含了“C:\MinGW\bin”。在我的电脑上重新启动之后,我就可以构建我的项目(Shift +Ctrl +B),没有问题。

< P>在花了两天的时间,我终于能够纠正VS代码上的安装C++,解决了错误。p> 根据上面的png图像,我已经在“用户变量为我”对话框下的用户变量“Path”中包含了“C:\MinGW\bin”。在我的计算机上简单地重新启动后,我就能够毫无问题地构建我的项目(Shift+Ctrl+B)

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.17134.0",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64/cl.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "msvc-x64",
            "browse": {
                "path": [
                    "${workspaceRoot}",
                    "C:\\MinGW\\lib\\gcc\\mingw32\\8.2.0\\include\\c++"
                ],
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": ""
            }
        }
    ],
    "version": 4
}