'Multiple libraries were found for "WiFi.h"' and 'The filename or extension is too long.'

I wanted to try out an image recognition code I found online (https://github.com/edgeimpulse/example-esp32-cam/tree/main/Examples/Basic-Image-Classification). It will allow me to deploy an Edge Impulse model to the ESP32 Cam to recognize images (in this case, apples, bananas and potatoes). I add the model into the Basic-Image-Classification.ino file which we can get as a zipped file from Edge Impulse.

However, I get two errors.

Multiple libraries were found for "WiFi.h"
Used: C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
fork/exec C:\Users\user\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-gcc.exe: The filename or extension is too long.
Error compiling for board AI Thinker ESP32-CAM.

How can I fix this? I am not sure which error to look into first.

The first is a warning, not an error. It is informing you that there are two WiFi libraries and it tells you which one it is using.

If you google the second one, you will find that having really long paths in windows exceeds some command line limit. Here is an example: "Filename or extension is too long" compilation error

The solution is to set your temporary build directory to something quite short like "C:\m" vs. having things way down under the user: C:\Users\user\AppData\Local\Arduino15\...

1 Like

If you are using an older version of the Arduino IDE, you should try updating to 1.8.19. The developers did some work to avoid this Windows command length error sometime in the last couple of years and I have not seen any reports from people experiencing it with the recent IDE versions.

You can download 1.8.19 here:

1 Like

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