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

How to configure Visual studio code for c++ in ubuntu

本文关键字:配置 Visual studio 代码 c++ 中为 ubuntu      更新时间:2023-10-16

如何为c++配置tasks.json

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

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

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

{
    "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
                }
            }
        }
    ]
}