步骤
1.打开工程所在文件夹,选中一个cpp文件,按F5,选择c++(windows)
2. 打开launch.json,选择c++(windows)
3. 修改launch.json如下,"program"修改成需要调试的程序路径。
- launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "启动",
"type": "cppvsdbg",
"request": "launch",
"args": ["args1","args2"],
"program": "D:/Project/xxxxx/GameServer.exe"
}
]
}
4. 在代码处加断点,按F5进入调试。
ps: 可能用vscode编译mfc项目也是可以实现的,但估计还是比较麻烦的,能调试Microsoft Visual Studio编译出来的程序,我已经满足了。