【问题标题】:Could not find the task 'C/C++: gcc build active file'找不到任务“C/C++:gcc 构建活动文件”
【发布时间】:2021-09-28 12:26:42
【问题描述】:

我正在使用 Microsoft 的 C/C++ v1.6.0 扩展 当我按 F5 在调试模式下运行我的代码时,我收到以下错误:

我阅读了一些其他建议配置 launch.json 的帖子,但我什至没有这个文件:

tasks.json的内容如下:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: clang build active file",
            "command": "/usr/bin/clang",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build",
            "detail": "compiler: /usr/bin/clang"
        }
    ]
}

【问题讨论】:

  • 当您没有所需的配置文件时,您自己创建它

标签: c visual-studio-code


【解决方案1】:

您可以尝试按 F1 并输入“build”或“debug”。 Visual Studio Code 对自动生成此类任务有很好的支持。 您还可以查看“运行和调试”窗格(左侧按钮或 Ctrl+Shift+D)。也许有一些提示。

【讨论】:

    猜你喜欢
    • 2023-03-23
    • 2015-07-09
    • 2022-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多