You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VS Code调试C++程序报错0x803d0014:程序可运行但无法调试

解决VS Code搭配MSVC 2022调试C++时出现0x803d0014错误的方案

问题现象

使用VS Code搭配MSVC 2022社区版进行x64架构C++开发,此前调试正常,近期启动调试时突然报错:

Unable to start debugging. Unable to start program '<程序名>'. Unknown Error: 0x803d0014

程序可通过命令行正常启动,编译过程无报错(编译日志如下),重启VS Code及电脑后问题仍存在。

编译日志:

[main] Building folder: dev 
[build] Starting build
[proc] Executing command: "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build c:/Users/wonix/dev/build --config Debug --target csvGen -j 10 --
[build] Version MSBuild 17.7.2+d6990bcfa pour .NET Framework
[build] 
[build]   Checking Build System
[build]   Building Custom Rule C:/Users/wonix/dev/csvGenerate/CMakeLists.txt
[build]   main.cpp
[build]   csvGen.vcxproj -> C:\Users\wonix\dev\build\csvGenerate\Debug\csvGen.exe
[driver] Build completed: 00:00:05.755
[build] Build finished with exit code 0

当前使用的launch.json配置:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "simple_example2",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "C:/Users/wonix/dev/build/csvGenerate/Debug/csvGen.exe",
            "args": [],
            "stopAtEntry": true,
            "cwd": "${fileDirname}",
            "environment": [],
            "console": "externalTerminal"
        }
    ]
}

解决方案

  • 检查路径与权限

    1. 确认launch.json中program字段的绝对路径完全正确,可尝试改用Windows原生反斜杠(需转义):"C:\\Users\\wonix\\dev\\build\\csvGenerate\\Debug\\csvGen.exe"
    2. 以管理员身份运行VS Code,避免文件访问权限限制导致调试器无法启动程序
  • 重置调试配置缓存

    1. 关闭VS Code,删除项目根目录下的.vscode文件夹(若需保留配置可先备份)
    2. 重新打开VS Code,通过“运行和调试”面板的向导重新生成launch.json配置
  • 验证MSVC调试器可用性

    1. 打开Visual Studio 2022社区版,创建一个新的x64控制台项目,尝试调试运行,确认MSVC自带的调试器功能正常
    2. 回到VS Code,检查C/C扩展、C Debugger扩展是否为最新版本,更新后重试调试
  • 调整调试控制台类型
    将launch.json中的console字段从externalTerminal改为integratedTerminal或internalConsole,示例:

    "console": "integratedTerminal"
    
  • 检查系统服务状态

    1. 按下Win+R输入services.msc打开服务管理器
    2. 找到Windows Management Instrumentation和**Remote Procedure Call (RPC)**服务,确认两者均处于“正在运行”状态,未运行则右键启动

内容的提问来源于stack exchange,提问作者Daniel Anderson

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 23:35:33