不知道题主的vscode用的爽不,我正好搜到你的,然后我解决了。一键直接编译调试,断点
vscode配置C/C++的编译调试环境
安装debug插件,然后配置如下,详情参考上面链接
//launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "gdb",
"request": "launch",
"target": "${file}.o",
"cwd": "${workspaceRoot}",
"preLaunchTask": "gcc"
}
]
}
//tasks.json
{
"version": "0.1.0",
"command": "gcc",
"args": ["-g", "${file}", "-o", "${file}.o"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
不知道题主的vscode用的爽不,我正好搜到你的,然后我解决了。一键直接编译调试,断点 vscode配置C/C++的编译调试环境 安装debug插件,然后配置如下,详情参考上面链接 //launch.json { "version": "0.2.0", "configurations":