hello:
最近在vscode上搞c、c++,在其中修改tasks.json ,现在已知其中args[]是为编译器指定一些参数,其中"-I"是指定include文件的,其中我想要添加多个inlude文件路径,但是当前我智能一个"-I"添加一个路径,且不能通过"/**"设置路径下的只文件。一个工程包含多个文件夹下头文件只能一个一个的添加路径吗。有没有知道的解释一波。3Q
路径在c_cpp_properties.json文件里配置,这个是c++插件的配置文件
我的配置如下
{
"configurations": [
{
"name": "g++",
"includePath": [
"${workspaceFolder}/**",
"D:/Apull/Program/MinGW/include/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "8.1",
"compilerPath": "D:/Apull/Program/MinGW/bin/g++.exe",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
"-fexec-charset=gbk"
],
"cStandard": "c11",
"cppStandard": "c++11",
"browse": {
"path": [
"${workspaceFolder}/**",
"D:/Apull/Program/MinGW/include/**"
],
"limitSymbolsToIncludedHeaders": true
}
}
],
"version": 4
}
task.json就很简单的了
{
"label": "g++debug",
"type": "shell",
"command":"g++",
"args": [
"${file}",
"-g"
]
}