首页 新闻 赞助 找找看

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

0
悬赏园豆:50 [已解决问题] 解决于 2019-12-31 16:03

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

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

秦朝掷弹兵的主页 秦朝掷弹兵 | 初学一级 | 园豆:81
提问于:2019-09-20 09:24
< >
分享
最佳答案
0

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

收获园豆:50
张朋举 | 小虾三级 |园豆:1915 | 2019-09-20 10:16

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

秦朝掷弹兵 | 园豆:81 (初学一级) | 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"
}
张朋举 | 园豆:1915 (小虾三级) | 2019-09-20 14:52

@秦朝掷弹兵: 我也是 主要是我曾经成功过,然后不知道为啥就这样了

Kin_Zhang | 园豆:200 (初学一级) | 2021-08-13 20:18

@秦朝掷弹兵: 想问一下楼主解决了吗,我现在也出现了这种问题

Wdstql | 园豆:200 (初学一级) | 2021-08-16 07:54
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册