Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code VSCode clangd扩展名找不到头文件_Visual Studio Code_Clang_Clang++_Clangd - Fatal编程技术网

Visual studio code VSCode clangd扩展名找不到头文件

Visual studio code VSCode clangd扩展名找不到头文件,visual-studio-code,clang,clang++,clangd,Visual Studio Code,Clang,Clang++,Clangd,我当前的文件结构是: ├── common │   └── example.cc ├── compile_commands.json ├── include    └── common    └── example.hh example.hh:保留为空 example.cc: #包括“common/example.hh” int main(){ 返回0; } compile_commands.json: [ { “目录”:“/主页/用户/项目”, “文件”:“/home/user

我当前的文件结构是:

├── common
│   └── example.cc
├── compile_commands.json
├── include
    └── common
        └── example.hh
example.hh
:保留为空

example.cc

#包括“common/example.hh”
int main(){
返回0;
}
compile_commands.json

[
{
“目录”:“/主页/用户/项目”,
“文件”:“/home/user/project/common/example.cc”,
“论点”:[
“/usr/bin/clang++”,
“-I/home/user/project/include”,
“-o示例”,
“/home/user/project/common/example.cc”
],
“输出”:“示例”
}
]
打开
example.cc
时会产生错误:

'common/example.hh' file not found clang(pp_file_not_found)
我直接运行命令,它工作正常:

$/usr/bin/clang++-I/home/user/project/include-o example/home/user/project/common/example.cc
环境信息:

$ clang++ --version
clang version 10.0.0-4ubuntu1 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
vscode:1.47.3

vscode clangd:0.1.7