|
发表于 2021-2-5 18:40:38
|
显示全部楼层
- {
- "version": "2.0.0",
- "tasks": [
- {
- "type": "shell",
- "label": "C/C++: gcc.exe build active file",
- "command": "[b]gcc[/b]", //这里改成你gcc的具体路径, D:/minGW/mingw64/bin/gcc.exe
- "args": [
- "-g",
- "${file}",
- "-o",
- "${fileDirname}\\${fileBasenameNoExtension}.exe"
- ],
- "options": {
- "cwd": "${fileDirname}"
- },
- "problemMatcher": [
- "$gcc"
- ],
- [b]"group": "build"[/b]
- }
- ]
- }
复制代码
group那里需要加:
- "group": {
- "kind": "build",
- "isDefault": true
- }
复制代码
- {
- "name": "(gdb) 启动",
- "type": "cppdbg",
- "request": "launch",
- "program": "${fileDirname}/${fileBasenameNoExtension}.exe",//测试文件地址
- "args": [],
- "stopAtEntry": false,
- "cwd": "${fileDirname}",
- "environment": [],
- "externalConsole": false,//在内部或外部运行
- "MIMode": "gdb",
- "miDebuggerPath": "D:/minGW/mingw64/bin/gdb.exe",//编译器gdb地址
- "setupCommands": [
- {
- "description": "为 gdb 启用整齐打印",
- "text": "-enable-pretty-printing",
- "ignoreFailures": true
- }
- ]
- },
复制代码
在这个文件后面加- ,
- "preLaunchTask": "C/C++: gcc.exe build active file"
复制代码
(直接复制到那个后面就行了) |
|