Platformio (Visual Code): Intellisense issues, cannot open source file stdlib.h (unrecognized command line option '-m64')

STM8 is a special case. It uses the SDCC compiler that VSCode (and a lot of other IDEs) don’t know how to handle, and so Intellisense is mostly wrong or missing. See also Erreurs #include détectées. Mettez à jour includePath. Les tildes sont désactivés pour cette unité de traduction · Issue #26 · platformio/platform-ststm8 · GitHub.

This has been tracked for over 4 years in Support SDCC as compiler · Issue #7146 · microsoft/vscode-cpptools · GitHub and request to support sdcc mcs51 declarations (__sfr, __sbit, etc) · Issue #2499 · microsoft/vscode-cpptools · GitHub with 0 interest from Microsoft

The best one can do is give intellise a little “hint” by adding

build_flags = -D_SDCC_

so that the Arduino.h header files at least choses some files which happen to exist in a local GCC or cl.exe installation…

1 Like