万能的谷民呀!救救我吧!
  • 板块灌水区
  • 楼主little_cindy
  • 当前回复8
  • 已保存回复8
  • 发布时间2022/1/19 22:34
  • 上次更新2023/10/28 11:53:22
查看原帖
万能的谷民呀!救救我吧!
357311
little_cindy楼主2022/1/19 22:34

配置VScode,怎么也不对。

报错如下:

> Executing task: D:\.vscode\g++ -g d:\Untitled-1.cpp -o d:\/Untitled-1.exe <

The terminal process failed to launch: Path to shell executable "D:\.vscode\g++" is not a file or a symlink.

终端将被任务重用,按任意键关闭。

配置文件launch.json

{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "ef",    
            "type": "cppdbg",  
            "request": "launch",  
            "program": "${fileDirname}/${fileBasenameNoExtension}.exe",
            "args": [],                
            "stopAtEntry": false,     
            "cwd": "${workspaceRoot}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\TDM-GCC-64\\bin\\gdb64.exe",
            "preLaunchTask": "g++",    
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

配置文件tasks.json:

{
    "version": "2.0.0",
    "tasks": [{
            "label": "g++",
            "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
            }
        }
    ]
}
2022/1/19 22:34
加载中...