总是显示这个表示执行任务,但是无法调试
Executing task: D:\MinGW-w64\mingw64\bin\g++.exe -g d:\code\code\Arcy\0920.cpp -o d:\code\code\Arcy/0920.exe <
终端将被任务重用,按任意键关闭。
请前辈给小弟指点一下,万分感谢
这是launch.json文件
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "D:/MinGW-w64/mingw64/bin/gdb.exe",
"preLaunchTask": "g++",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
},
]
}
这是tasks.json文件
{
"version": "2.0.0",
"command": "g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}.exe"
],
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.):(\d+):(\d+):\s+(warning|error):\s+(.)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
},
"group": {
"kind": "build",
"isDefault": true
}
}
直接成功了,没法重新你的问题;
建议你删了配置重新F5走起。
https://blog.csdn.net/qq_43041976/article/details/88544643
按照你的帖子重新写了一遍,还是不行,一样终端将被任务重用,头大想换个编译器
@秦朝掷弹兵: 我用的codeblocks-17.12mingw-nosetup,自带的
https://pan.baidu.com/s/1ogBZy9dixzNwcACHvt9C_g
hello.c
#include <stdio.h>
int main(int argc, char *args[])
{
printf("hello world!\n");
return 0;
}
launch.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": "gcc.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "gdb32.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "gcc.exe build active file"
}
]
}
tasks.json
{
"tasks": [
{
"type": "shell",
"label": "gcc.exe build active file",
"command": "D:\\Downloads\\app\\codeblocks-17.12mingw-nosetup\\MinGW\\bin\\gcc.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "D:\\Downloads\\app\\codeblocks-17.12mingw-nosetup\\MinGW\\bin"
}
}
],
"version": "2.0.0"
}
@秦朝掷弹兵: 我也是 主要是我曾经成功过,然后不知道为啥就这样了
@秦朝掷弹兵: 想问一下楼主解决了吗,我现在也出现了这种问题