Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clangd-lsp does not recognize header files #50

Open
Gabriel-Dropout opened this issue Sep 14, 2023 · 0 comments
Open

clangd-lsp does not recognize header files #50

Gabriel-Dropout opened this issue Sep 14, 2023 · 0 comments

Comments

@Gabriel-Dropout
Copy link

First of all, to use Clangd's LSP feature, I set set(CMAKE_EXPORT_COMPILE_COMMANDS ON) in CMakeLists.txt. This makes the compile commands to be written to the compile_commands.json file, which helps the language server understand the project structure.

However, using cmrc_add_resource_library() in CMakeLists.txt causes some header files to not recognize other header files. For example, the project structure is as follows

│  CMakeLists.txt
│  CMakeRC.cmake
├─build
├─include1
│      header1.h
├─include2
│      header2.h
├─resources
│      kitty.png
└─src
        main.cpp

in this case, if header1.h imports header2.h, LSP says it could not find the file. (However, it will compile and build normally!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant