clangd still cannot find header files after specifying the include options
See original GitHub issueI am using Windows 11, and I have downloaded the gcc compiler from mingw-w64, which should include all the basic system headers, and I am using clangd for vscode.
For some reason, clangd still has a hard time trying to find all the basic header files, even when I specify multiple -isystemC:\path\to\includes
. For example, clangd still fails to find bits/c++config.h
.
I have made a .clangd
file to specify the includes.
CompileFlags:
Add: [
-std=c++20,
"-isystemC:\\Users\\me\\Documents\\x86_64-12.2.0-release-posix-seh-rt_v10-rev0\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\12.2.0\\include",
"-isystemC:\\Users\\me\\Documents\\x86_64-12.2.0-release-posix-seh-rt_v10-rev0\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\12.2.0\\include\\c++",
"-isystemC:\\Users\\me\\Documents\\x86_64-12.2.0-release-posix-seh-rt_v10-rev0\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\12.2.0\\include\\c++\\x86_64-w64-mingw32",
"-isystemC:\\Users\\me\\Documents\\x86_64-12.2.0-release-posix-seh-rt_v10-rev0\\mingw64\\include",
"-isystemC:\\Users\\me\\Documents\\x86_64-12.2.0-release-posix-seh-rt_v10-rev0\\mingw64\\x86_64-w64-mingw32\\include"
]
Am I missing something? Sorry if this is not the place to get help with clangd.
Issue Analytics
- State:
- Created a year ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Clangd cannot find a header file · Issue #695 - GitHub
Since header files don't have their own entries in compile_commands.json , clangd has to choose one of the source files which do have...
Read more >Clangd errors in header files - LLVM Discourse
Right now I'm trying to use this setup to work in suckless org projects like dwm which consist of large .c files, configuration...
Read more >Why can't Clang find my header files while GCC can?
a ) that I need to link to my code. I have the library in some "lib" folder inside some "src" folder. I...
Read more >The clangd extension can't find includes : r/vscode - Reddit
I 've recently installed the clangd extension and its create in every way except it reports that header files are missing.
Read more >Modules — Clang 8 documentation - bcain-llvm
Compile-time scalability: Each time a header is included, the compiler ... use -fmodule-map-file= option to explicitly specify the module map files to load....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The logs are showing that:
--query-driver
is now working, based on the following:testlib.cpp
.There are diagnostics issued when you open
<iostream>
, the reason for that is:this can be fixed using https://clangd.llvm.org/faq#how-do-i-fix-errors-i-get-when-opening-headers-outside-of-my-project-directory.
Once https://github.com/clangd/clangd/issues/1089 is fixed, it should be enough to add:
to the clangd config file (and
--query-driver=/path/to/g++
to the clangd command line), andcompile_commands.json
will not be required.