【c++】vscode调试mfc程序

步骤

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编译出来的程序,我已经满足了。

猜你喜欢

转载自blog.csdn.net/weixin_41093846/article/details/129736954