我已经尝试了堆栈溢出的大部分方法,包括使用外部控制台值,使用以前版本的C/C++扩展,将cppbuild更改为shell等。似乎没有任何效果。如果我按调试键,我会收到一个错误消息,说启动程序'...launch.exe'不存在。
下面是我的启动.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++.exe - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "C:\\msys64\\mingw64\\bin",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file",
"miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe"
}
]
}
下面是我的任务.json:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "C/C++: gcc.exe build active file",
"command": "C:\\msys64\\mingw64\\bin\\gcc.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: C:\\msys64\\mingw64\\bin\\gcc.exe"
},
{
"label": "run make",
"type": "shell",
"command": "make"
},
{
"label": "run make test",
"type": "shell",
"command": "make test"
}
]
}
1条答案
按热度按时间kr98yfug1#
“预启动任务”:launch.json中的“C/C++:g++.exe构建活动文件”,应与“标签”一致:tasks.json中的“C/C++:gcc.exe构建活动文件”。