按F1或 Ctrl+Shift+p 在弹出的备选选项中选择 C/C++:Edit Configuration(JSON)
自动打开c_cpp_properties.json配置文件,如下:
在configurations下includePath中添加路径,路径名称用双引号标注,以逗号分隔。
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "gnu++14",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}