Closed PaNDa2code closed 2 months ago
Hey there,
I realized I forgot to mention that I made changes to the config file. Here's the old configuration, which was working fine only for C:
CompileFlags:
Compiler: x86_64-w64-mingw32-gcc
Add: ["-I../headers", "-I$INCLUDE_PATH"]
Now, I encountered an issue with the new config. It's throwing an error message here:
E[17:59:03.566] config error at /home/panda/.config/clangd/config.yaml:24:0: Config should be a dictionary
Do you think this problem is related to my new config? If so, how can I configure clangd to use Mingw compilers for both C and C++?
It looks like the reason for that error is the trailing ---
. A ---
starts a new config fragment and clangd doesn't expect a fragment to be empty.
Does removing the trailing ---
help?
I resolved these issues by hardcoding the include paths, That's working well.
If:
PathMatch: .*\.c
CompileFlags:
Compiler: x86_64-w64-mingw32-gcc
Add: ["-I../headers", "-I$INCLUDE_PATH"]
If:
PathMatch: .*\.cpp
CompileFlags:
Compiler: x86_64-w64-mingw32-g++
Add: ["-I../headers", "-I$INCLUDE_PATH", "-I/usr/lib/gcc/x86_64-w64-mingw32/12-win32/include/c++", "-I/usr/lib/gcc/x86_64-w64-mingw32/12-win32/include/c++/x86_64-w64-mingw32", "-I/usr/lib/gcc/x86_64-w64-mingw32/12-win32/include/c++/backward"]
---
Hey there,
I've been using Neovim with clangd for C and C++, and I'm encountering an issue with my configuration when working with C++ files that include
windows.h
. While I've set up my configuration fileconfig.yaml
to use MinGW compilers without any problem for C files, it seems like clangd can't findwindows.h
when processing C++ files.Here's my
config.yaml
:However, when I include
windows.h
in a C++ file and run clangd, it gives me an error saying that the file is not found:I've tried adjusting the paths and configurations, but haven't had any luck so far. Any suggestions on how to resolve this would be greatly appreciated.
Thanks!