Godot Version
4.6.1 but not applicable
Does anyone have any experience configuring clangd for working on a gdextension that uses cmake ?
Running configure on the cmake project generates the compile_commands.json file as well as a .clangd file in the topmost project folder.
This all works to some extent, but clangd throws errors for some of the included content from the godot-cpp bindings.
I tried setting GODOTCPP_SYSTEM_HEADERS to on but it made no difference.
Any and all suggestions would be greatly appreciated. Note project builds and launches correctly.
Edit:
I get the same results if I use a vanilla version of the template and generate the compile_commands.json with scons.
Further Edit:
In trying to figure out the problem, i checked my gcc version:
gcc --version
Which returned version 14, however when I checked what version clang
clang++ -v
Which showed this:
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/13
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/14
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/15
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/7
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/15
Once I installed the development package for gcc 15, most of the errors went away. It still shows an error on the #pragma once preprocesser directive but that isn’t that big of a deal.
Another Edit:
To fix the problem with the #pragma once directive I added this to the .clangd file under CompilerFlags like so:
Remove: [-fno-gnu-unique]
Is there a way to mark this post as the solution, or do I have to actually post the solution above in a new reply?
