c++ - 如何在 ubuntu 中为 c++ 配置 Visual Studio 代码

标签 c++ visual-studio-code

如何为 C++ 配置 tasks.json

当我使用默认配置并运行 C++ 代码时,它会给我:

Failed to launch external program tsc HelloWorld.ts.
spawn tsc ENOENT

最佳答案

这是我的 tasks.json。我在某个地方找到了它,使用 Make 对我来说效果很好。

{
    "version": "0.1.0",
    "command": "make",
    "isShellCommand": true,
    "tasks": [
        {
            "taskName": "Makefile",
            // Make this the default build command.
            "isBuildCommand": true,
            // Show the output window only if unrecognized errors occur.
            "showOutput": "always",
            // No args
            "args": ["all"],
            // Use the standard less compilation problem matcher.
            "problemMatcher": {
                "owner": "cpp",
                "fileLocation": ["relative", "${workspaceRoot}"],
                "pattern": {
                    "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
                    "file": 1,
                    "line": 2,
                    "column": 3,
                    "severity": 4,
                    "message": 5
                }
            }
        }
    ]
}

关于c++ - 如何在 ubuntu 中为 c++ 配置 Visual Studio 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32975034/

相关文章:

c++ - 追踪 shared_ptr 的所有者?

c++ - 为什么它总是给出零输出?

asp.net-mvc - 如何将模型值从 View 传递到 Controller ?

typescript - 如何隐藏函数参数缺失类型通知?

visual-studio-code - 调试时忽略自己/指定的文件?

初始化列表中的 C++ 临时变量

c++ - 标准实验闩锁和势垒使用ptrdiff_t

C++ 接口(interface)的公共(public)虚拟继承与实现的私有(private)继承

c# - 如何在 Visual Studio Code 上生成 switch 语句标签?

c# - Visual Studio Code .NET Core 项目显示详细的调试控制台消息