-
Notifications
You must be signed in to change notification settings - Fork 59
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 does not recognize c++ standard library headers #2018
Comments
Please start by looking at https://clangd.llvm.org/troubleshooting#cant-find-standard-library-headers-map-stdioh-etc and https://clangd.llvm.org/guides/system-headers#query-driver
|
Thank you very much, this is definitely a progress! I have added the line
This is great, but I would still like to understand why this suddenly happened and why it worked without this line before. |
Also I realized on more thing: this solution for some reason messes up the colorscheme -- all the variables are green (in the case of the colorscheme I am using) instead of just white. |
If you share verbose logs without |
Thank you very much! It is quite a mess, but here is the log file.
|
Unfortunately these logs are incomplete. I'm looking for the full stderr from the server, these seem to include only one line from the server's stderr, and a bunch of client-side logging. |
Thank you! I used the verbose option now. I do not know why I did not use it before.
|
Ok, so the relevant parts of the log are:
In the absence of And then:
which tells us that, based on this compiler path, clangd came up with the following system include directories:
The path for C++ standard library includes, in particular, is Presumably, if you're getting unresolved include errors, this path ( |
Ok, I see the problem. The path exists, but for some reason it does not contain the include files that I am looking for only some that I am absolutely not familiar with:
|
Ok, so I found out that the path for C++ standard library includes actually is |
I am using neovim and clangd. I set up neovim using nvchad and clangd exactly according to this video (https://www.youtube.com/watch?v=lsFoZIg-oDs) many months ago mainly for the purpose of autocompletion. Then I did not use c++ for a while and now I have problem with clangd recognizing standard c++ headder files. The autocompletions works. The only real change that happened in between on my system must have been the latest updates of macOS.
I tried to google a lot of things and also look at the clangd troubleshooting. It usually advices to set up a "compile_commands.json" file, but I did not have to do this before and it worked. Also, I tried this solution, but nothing changed.
System information
Output of
clangd --version
:Apple clangd version 15.0.0 (clang-1500.3.9.4)
Features: mac+xpc
Platform: x86_64-apple-darwin23.4.0
Editor/LSP plugin:
neovim
Operating system:
macOS Sonoma 14.4.1
The text was updated successfully, but these errors were encountered: