-
-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constant include errors with ClangD and generated compile_commands.json #4684
Comments
This is a bug and fixed it. Please re-test with |
Thanks @ivankravets it works <3 |
This issue
I am using MacVim, using
my program is just an empty arduino sketch:
EDIT: Solved by adding the following to |
What kind of issue is this?
Configuration
Operating system: KDE Neon 5.27
PlatformIO Version: 6.1.7
Description of problem
ClangD includes either system header files or doesn't see them at all.
If you include
Arduino.h
you'll get this error if you don't havegcc-multilib
installed on your system:clang: 'bits/libc-header-start.h' file not found [pp_file_not_found]
.If you do have
gcc-multilib
on your system then you'll get this error instead:clang: In included file: 'avr/pgmspace.h' file not found [pp_file_not_found]
.When looking into the
Arduino.h
file I can see that eg. thebits/libc-header-start.h
is from the system header files instead of the Arduino ones:Image
Steps to Reproduce
pio project init --board uno
touch src/main.cpp
main.cpp
#include <Arduino.h>
and see the errorpio run -t compiledb
include
directory and do the same as inmain.cpp
Expected Results
ClangD correctly solving header paths so the code completion works
If problems with PlatformIO Build System:
The content of
platformio.ini
:Source file to reproduce issue:
Additional info
While writing this issue I figured out that it works as expected if you first run
pio project init --board uno && pio run -t compiledb
and then create themain.cpp
file with#include <Arduino.h>
. If you do it the other way around or you runpio run -t compiledb
after creating themain.cpp
file you'll get these errors.The text was updated successfully, but these errors were encountered: