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