vim-lsp-settings icon indicating copy to clipboard operation
vim-lsp-settings copied to clipboard

clangd can not find STL headers on MacOS

Open kenroser opened this issue 2 years ago • 3 comments

I'm using MacOS Catalina and the latest version of vim-lsp. My problem is that STL headers don't seem to be found by clangd.

If I do a clangd --check= I get errors such as E[09:37:33.030] [pp_file_not_found] Line 12: 'memory' file not found

I'm using a very current version of clangd,

$ clangd --version
Homebrew clangd version 13.0.0
Features: mac+xpc
Platform: x86_64-apple-darwin19.6.0

I am using a compile_commands.json.

My problem sounds similar to the one described in https://github.com/mattn/vim-lsp-settings/issues/159 , but that's already resolved.

kenroser avatar Nov 18 '21 14:11 kenroser

Probably, it's a problem of clangd.

https://github.com/clangd/clangd/issues/556

mattn avatar Nov 18 '21 15:11 mattn

Perhaps it is a clangd problem, but that clangd ticket referred to is for Windows 10. Strangely though, the clangd on my Mac that's used by CLion doesn't exhibit this problem.

kenroser avatar Nov 19 '21 15:11 kenroser

I found the solution to be: CPLUS_INCLUDE_PATH=/Library/Developer/CommandLineTools/usr/include/c++/v1/

kenroser avatar Mar 21 '22 17:03 kenroser