为什么Visual Studio代码会显示g ++ .exe错误:找不到目录?

问题描述

每当我尝试在Visual Studio代码上编码时,它都会向我显示此错误。我已经根据其官方页面上的给定说明设置了Visual Studio代码。我只是不知道那里是什么问题?请在终端部分查看此错误。帮助我弄清楚我的设置令人沮丧的地方出了什么问题。如果您在Visual Studio代码上设置了c ++,请告诉我。 enter image description here

这是我的task.json

{
"version": "2.0.0","tasks": [
    {
        "type": "shell","label": "C/C++: g++.exe build active file","command": "C:\\MinGW\\bin\\g++.exe","args": [
            "-g","${file}","-o","${fileDirname}\\${fileBasenameNoExtension}.exe"
        ],"options": {
            "cwd": "${workspaceFolder}"
        },"problemMatcher": [
            "$gcc"
        ],"group": {
            "kind": "build","isDefault": true
        }
    }
]

}

这是我的launch.json

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information,visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0","configurations": [

    {
        "name": "g++.exe - Build and debug active file","type": "cppdbg","request": "launch","program": "${fileDirname}\\${fileBasenameNoExtension}.exe","args": [],"stopAtEntry": false,"cwd": "${workspaceFolder}","environment": [],"externalConsole": false,"MIMode": "gdb","miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe","setupCommands": [
            {
                "description": "Enable pretty-printing for gdb","text": "-enable-pretty-printing","ignoreFailures": true
            }
        ],"preLaunchTask": "C/C++: g++.exe build active file"
    }
]

}

这是我的c_cpp_properties.json

{
"configurations": [
    {
        "name": "Win32","includePath": [
            "${workspaceFolder}/**"
        ],"defines": [
            "_DEBUG","UNICODE","_UNICODE"
        ],"compilerPath": "C:\\MinGW\\bin\\gcc.exe","cStandard": "c11","cppStandard": "c++17","intelliSenseMode": "gcc-x86"
    }
],"version": 4

}

和setting.json

{
"C_Cpp.errorSquiggles": "Disabled"

}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...