首页 > 解决方案 > 为什么我在创建 task.json 后立即在 vscode 上收到错误?

问题描述

我想在vscode上创建一个task.json,我使用了Tasks:Configure Task,选择C/C++ g++.exe,然后我得到了这个。输出是什么意思?我怎样才能改变这个?谢谢你的回答。

Error: the description can't be converted into a problem matcher:
{
    "owner": "cpp",
    "fileLocation": [
        "relative",
        "${workspaceFolder}"
    ]
}

这是我的 task.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: g++.exe 生成活动文件",
            "command": "D:\\mingw64\\bin\\g++.exe",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build",
            "detail": "编译器: D:\\mingw64\\bin\\g++.exe"
        }
    ]
}

标签: c++visual-studio-code

解决方案


推荐阅读