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

时间:2015-10-06 16:29:59

标签: c++ visual-studio-code

如何为c ++配置tasks.json

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

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

1 个答案:

答案 0 :(得分:0)

这是我的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
                }
            }
        }
    ]
}