【发布时间】:2018-11-08 13:58:06
【问题描述】:
我有一个Visual Studio Code tasks.json 文件可以通过g++ 运行C++ 文件:
{
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "g++",
"args": [
"-I ~/vcpkg/installed/x64-osx/include/",
"test.cpp"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
问题是生成的命令> Executing task: g++ '-I ~/vcpkg/installed/x64-osx/include/' test.cpp < 有单引号,所以这不起作用。
我看了here 并尝试了这个:
{
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "g++",
"args": [
{
"value": "-I ~/vcpkg/installed/x64-osx/include/",
"quoting": "escape"
},
"test.cpp"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
问题是生成的命令> Executing task: g++ -I\ ~/vcpkg/installed/x64-osx/include/ test.cpp < 使用escape 所以有一个\。
如何生成所需的命令:
g++ -I ~/vcpkg/installed/x64-osx/include/ test.cpp
【问题讨论】:
标签: json visual-studio-code intellisense