Platformio Failure to build demos or random No Such File or Directory when adding libraries

xtensa-esp32s3-elf-g++: error: CreateProcess: No such file or directory
xtensa-esp32s3-elf-g++: error: CreateProcess: No such file or directory
Compiling .pio\build\esp32-s3-devkitc-1-myboard\lib6fa\Wire\Wire.cpp.o
*** [.pio\build\esp32-s3-devkitc-1-myboard\src\main.cpp.o] Error 1
*** [.pio\build\esp32-s3-devkitc-1-myboard\src\ota.cpp.o] Error 1

Errors like these took me a long time to figure out. This is the platformio HMI 7" display project. Adding any library resulted in the project not building and no further changes would fix it even undoing what you just added.

To cut a long story short, this is because the custom framework and long name esp32-s3-devkitc-1-myboard results in the compiler busing the 8191 character limit on the command line, so the arguments get truncated and it obviously can't find the file its just been passed.

The solution is to move your .platformio folder somewhere with a shorter path.
Open the CLI and type set PLATFORMIO_HOME_DIR=C:\platformio and then also set it in the system environment variables. Restart platformio and it will re-download the packages and then it will work.

This [particular error probably causes many seemingly unrelated headaches.
Reference to my exact thought process:
https://community.platformio.org/t/unhelpful-error-message-on-compilation-failure/44539/13

Sign In or Register to comment.