Thanks for the complete and minimal example. However, it works without a problem on my machine.
Where is the error message shown? Does it appear as a tooltip when hover over red squiggly lines in the source code editor? If so, can you show a screenshot of the Visual Studio Code extension you have installed?
I think this is a linux-specific issue - probably exposed by the
reference in MySensors_ID548/hal/transport/RS485/MyTransportRS485.cpp. The file does exist at MySensors_ID548/drivers/Linux/SerialPort.h but doesn’t seem to be needed, but IntelliSense seems to be having trouble working down the pre-processor macro chain… i.e. after opening a few of the includes along the way… it’s no longer whining about SerialPort.h and now that it can’t open ‘string’… Anyway… unless this was code for the Raspberry Pi… You should be fine to ignore this errant IntelliSense warning.
Is the project building successfully in PlatformIO? → Use Ctrl+Shift+P → Rebuild IntelliSense to fix it.
If it is not building then there is a real problem. Please then open a new topic with all the details (platformio.ini, used code).
vscode After I added the library about TFT_eSPI from platformio libraries, main.There was an issue with header files showing red squiggly lines in c, and I restarted vscode and didn’t solve the problem.
You are using the TFT_eSPI library presumably from
which strictly declares compatibility with only the Arduino framework. You are attempting to use it with the ESP-IDF framework. This will not work, it needs the Arduino libraries.
The only way this can possible work is if you use the “ESP-IDF plus Arduino-ESP32 as a component” framework method as shown in this example. Otherwise you need to find a library that is compatible with only ESP-IDF and has no dependencies to Arduino.
You can also force the library compatibility check to be off, see docs with lib_compat_mode = off, but since the Arduino headers are probably not there in your project, this will run into a compilation failure.