关于VScode
  • 板块灌水区
  • 楼主xiaofu15191
  • 当前回复5
  • 已保存回复5
  • 发布时间2021/7/21 13:14
  • 上次更新2023/11/4 13:58:04
查看原帖
关于VScode
242317
xiaofu15191楼主2021/7/21 13:14

最近重装系统,新下了个VScode,配置了launch.json和tasks.json,还是无法调试,可以编译,但编译后不启动调试,怎么回事?

另附代码:

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": "gdb.exe",
            "preLaunchTask": "compile",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
        },
    ]
}

tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "compile",
            "command": "g++",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

求助,qaq

2021/7/21 13:14
加载中...