2
我想編譯在Visual Studio代碼一段cpp的文件,因此我設置了以下tasks.json:任務在Visual Studio代碼沒有找到文件
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "g++-5",
//"args": ["-O2", "-Wall", "${file}", "-o ${fileBasename}"],
"isShellCommand": true,
"tasks": [
{
"taskName": "Compile",
// Make this the default build command.
"isBuildCommand": true,
// Show the output window only if unrecognized errors occur.
"showOutput": "always",
// No args
//"args": ["all"],
"args": ["-O2", "-Wall", "${file}", "-o ${fileBasename}"],
// 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
}
}
}
]
}
但現在,如果我切換到有問題的文件(它位於.vscode
-folder,其中是tasks.json文件所在的位置),並執行編譯任務,從gcc中得到「文件未找到」作爲錯誤。我的json代碼中的問題在哪裏?