I just starting working on a Win32 application and I'm editing in Neovim. I'm running off WSL and using clangd as my LSP. To compile I'm using Microsoft cl and it's building the binary fine.
I was refactoring some code and I encountered a weird LSP error when moving my #include <dsound.h>
from it's original main.cpp to a new header file (windows_sound.h). My LSP gave me the following complaint: clang: In included file: unknown type name 'interface'.
This error shows up even when it's the only thing in the file (without include guards). However, if I move the include into an empty .cpp (windows_sound.cpp) the LSP gives me no errors. Any idea what's going on?
My .clangd (which points to MingW64's windows header files):
CompileFlags:
Add:
- "--target=x86_64-w64-windows-gnu"
- "-std=c++20"
- "-fms-extensions"
- "Wall"
- "-isystem/usr/share/mingw-w64/include/"
My clangd version: 15.0.6
nvim version: 0.8.0-1210
The only additional thing I do in my config is I modified the clangd command to:
cmd =
{
"clangd",
"--header-insertion=never",
},