使用visualstudio代码和lunch.json文件调试c++代码时出现问题



我在Visual studio代码中调试c++程序时遇到问题。尽管如此,调试以前是有效的。我没有更改任何配置或设置。当我今天打开visualstudio代码时,我看到了这个错误。图像

午餐.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": true,
"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": "g++.exe build active file"
}
]
}

我没有更改系统/vc代码/配置等中的任何内容。那么,为什么调试停止工作。

程序设置指定要调试的程序。在这里,它被设置为活动文件夹${fileDirname}和扩展名为.exe的活动文件名${fileBasenameNoExtension}.exe,如果helloworld.cpp是活动文件,它将是helloworld.exe。
主要问题是vccode找不到要调试的当前文件
这些链接可能对您有用。
文档

配置

最新更新