【发布时间】:2020-04-15 13:05:34
【问题描述】:
我在 Visual Studio 代码 中调试 c++ 程序时遇到问题。虽然,调试之前工作。我没有更改任何配置或设置。当我今天打开 visual studio code 时,我看到了那个错误。 Image
lunch.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 代码/配置等中的任何内容。 然后,为什么调试停止工作。
【问题讨论】:
-
可执行文件是否创建成功?错误说它不存在,所以你应该确保它真的被创建了
-
是的,可执行文件创建成功。它正在运行并产生输出。没有错误。
标签: c++ debugging visual-studio-code