【发布时间】:2021-07-13 04:33:34
【问题描述】:
VSC更新到新版本(1.58.0)后,无论是InternalConsole还是ExternalConsole都不能自动运行cl.exe编译成功的.EXE文件。我已经配置了 .JSON 文件,而它在以前版本的 VSC 中运行良好。 JSON文件代码如下。
// lauch.json
"version": "0.2.0",
"symbolsearchpath": "https://msdl.microsoft.com/download/symbols",
"configurations": [
{
"name": "cl.exe build and debug active file",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"console":"externalTerminal",
"preLaunchTask": "cl.exe build active file"
}
]
// task.json
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "cl.exe build active file",
"command": "cl.exe",
"args": [
"/Zi",
"/EHsc",
"/Fe:",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"${file}"
],
"problemMatcher": ["$msCompile"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
按 F5 后,VSC 可以编译 C++ 项目,但即使我提交了一些断点,也无法运行或调试。
【问题讨论】:
-
您能否更清楚地解释一下当您尝试运行程序时会发生什么?有错误吗?您是否检查了各种输出窗口是否有错误?
-
感谢您的回复!我已经解决了这个由 Windows Debugger 未安装引起的问题。我尝试在扩展(Windows 调试器)完全安装之前调试或运行我的程序,会遇到这个问题。
标签: c++ visual-studio-code visual-c++