我正在尝试在 VSCode 中运行 C 程序。我正在努力获取有效的 launch.json 文件,但它抱怨
"type": "cppvsdbg"
行,说“已安装配置的调试类型‘cppvsdbg’,但在此环境中不受支持。”
我尝试根据 VSCode 网站重新开始和调试,但他们让我使用
"type": "cppdbg"
选项,这对我不起作用,因为它不允许像 "console"
这样的新选项。我也尝试在这个错误中搜索关键字,但只能找到使用不同语言(主要是Python)的类似帖子。所以我们来了!
我正在使用 M1 Max 芯片运行 Mac,OS Monterey 12.6。我的 VSCode 版本是最新的,“1.71.0(通用)”。
我的理解是 cppvsdbg 仅适用于 Windows
{
"name": "Debug (Windows)",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Debug/MyApp.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"console": "integratedTerminal",
"preLaunchTask": "build_debug"
},
{
"name": "Debug (GDB)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Debug/MyApp.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"console": "integratedTerminal",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build_debug"
}
在
launch.json