描述:
\n我使用clangd作为语言服务器,在 vscode 中使用 CMake 进行 c/c++ 编码。
\n然而,我遇到了一些烦人的错误,这些错误一直困扰着我。
\nforehead/include.h\' file not found clang(pp_file_not_found)\n
错误再现:
\n我有一个名为的目录include,如下所示:
.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 CMakeLists.txt\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 forehead\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 include.h\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 graph\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 graph.h\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 list\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 linklist.h\n...\nRun Code Online (Sandbox Code Playgroud)\n在 中linklist.h,clangd 工作正常,没有错误或警告,我可以使用以下命令跳转到include.h文件gd:
#include <forehead/include.h>\nRun Code Online (Sandbox Code Playgroud)\n但是,clangd 中的完全相同的行graph.h不断给我错误:forehead/include.h\' file not found clang(pp_file_not_found),阻止我跳转到该文件,每个关键字或函数都include.h被 clangd 视为错误。
环境:
\nroot/CMakeLists.txt …