Include Errors Arduino CLI w/VSCode

I am getting these include errors for the SD, Adafruit BusIO, and ESP32 Servo libraries after a fresh install of Arduino CLI in Visual Studio Code. Can anybody help?

Arduino CLI is a Go (golang) program that scans directories to build library paths, then calls native platform C++ compilers to build sketches. The CLI is also bundled with and serves as the back-end for the Arduino IDE.

What it looks like you're asking about is the configuration for the just plain Arduino plug-in for VSCode, which interfaces with the C++ compilers directly.

Instead of (or in addition to) screenshots, you should post code and error messages as <CODE/> here using the toolbar button above. But squinting, it appears that your includePath only has a few Library entries. It is entirely missing all the Board platform libraries, which would include the critical Arduino.h for example.

Here is an excerpt I have handy

"includePath": [
    "${userHome}/.arduino15/packages/m5stack/hardware/esp32/2.1.1/libraries/**",
    "${userHome}/.arduino15/packages/m5stack/hardware/esp32/2.1.1/cores/esp32/**",
    "${userHome}/Arduino/libraries/**",
    "${userHome}/.arduino15/packages/m5stack/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/sys-include",
    "${userHome}/.arduino15/packages/m5stack/hardware/esp32/2.1.1/tools/sdk/esp32/include/**",
    "${userHome}/.arduino15/packages/m5stack/hardware/esp32/2.1.1/tools/sdk/esp32/include/newlib/platform_include",
    "${userHome}/.arduino15/packages/m5stack/hardware/esp32/2.1.1/tools/sdk/esp32/qio_qspi/include",
    "${userHome}/.arduino15/packages/m5stack/hardware/esp32/2.1.1/variants/m5stack_coreink"
],

for Linux, where the Boards are under ~/.arduino15 and the sketchbook is ~/Arduino. (The ${userHome} should work on Windows.) The board is an M5Stack CoreInk, which is ESP32. In addition to using ** for every Library, under the Board platform directory are

  • the boards' libraries (like WiFi)
  • the boards' cores (which contains Arduino.h)
  • three other individual directories for M5Stack boards
  • one other **
  • a board-specific directory

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.