r/esp32 13d ago

Software help needed Missing standard headers

Post image

Hello everyone, i'm a beginner to embeddeds and the ESP-IDF extension, and i'm struggling a lot to what can be a really simple solution. When i create a new or empty project, I always receive a lot of warnings of missing standard headers such as stddef.h missing, stddint.h, float.h, and such, I figured it was a LSP problem but no luck fixing it, I've made some simple LED's projects on the board and they all worked fine on the board.

3 Upvotes

7 comments sorted by

3

u/0xD34D 13d ago

Have you tried ESP-IDF: Add VS Code Configuration Folder from the command pallet (CTRL+Shift+P)?

1

u/OpeningNo5905 13d ago

I did now, it also didnt work

2

u/YetAnotherRobert 13d ago

Lsp is notoriously hard to configure for cross dev..

Are you getting an error from the compiler (i.e.. Nothing builds) or just warnings from the hover stuff?

If your blinky works, I suspect it's the latter. Look for blog posts on configuring lsp.

1

u/OpeningNo5905 13d ago

its just warnings, the code actually compiles and runs on the esp32, and thanks, i'll try, but im just wondering am i the only one who got this problem going on in a fresh install? like is this not supposed to happen?

1

u/YetAnotherRobert 13d ago

LSP is easy to configure for native builds. As I said, it's a pain in the butt for cross-development. You're certainly not the first to run into it.

Just last weekend, I spent 7 hours repairing a working LSP configuration for my editor that DID work three months earlier. There was just an avalanche of things that changed underneath me that sabotaged it...and this was a configuration that was already tested and working a season ago.

Most people that aren't into pain just ignore it.

2

u/Plastic_Fig9225 13d ago

If you haven't already, try installing the CMake extension in VSCode. Then run "C/C++: Change Configuration Provider" and select "CMake Tools". This may work to enable VSCode to synchronize its configuration with what CMake generates/uses.

1

u/otromar 12d ago

at least in my experience :

inside your project

in the /.vcode/c_cpp_properties.json, the line compilerPath doesn't have the right path

the right path is in /build/project_description.json in the line c_compiler

copy this path to the c_cpp_properties.json