首页新闻找找看学习计划

VScode无法调试了,请前辈帮帮我

0
悬赏园豆:50 [待解决问题]

总是显示这个表示执行任务,但是无法调试

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
}
}

秦朝掷弹兵的主页 秦朝掷弹兵 | 初学一级 | 园豆:152
提问于:2019-09-20 09:24
< >
分享
所有回答(1)
0

直接成功了,没法重新你的问题;
建议你删了配置重新F5走起。
https://blog.csdn.net/qq_43041976/article/details/88544643

张朋举 | 园豆:1293 (小虾三级) | 2019-09-20 10:16

按照你的帖子重新写了一遍,还是不行,一样终端将被任务重用,头大想换个编译器

支持(0) 反对(0) 秦朝掷弹兵 | 园豆:152 (初学一级) | 2019-09-20 14:45

@秦朝掷弹兵: 我用的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"
}
支持(0) 反对(0) 张朋举 | 园豆:1293 (小虾三级) | 2019-09-20 14:52
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册