ESP32 Error When Compiling

Hello. I'm trying to compile software for my ESP-WROOM-32. When I compile I get this returned in the console: c:/users/jjohn/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find crt1-sim.o: No such file or directory c:/users/jjohn/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find _vectors.o: No such file or directory collect2.exe: error: ld returned 1 exit status exit status 1 Error compiling for board ESP32 Dev Module.

Here's my code:

#define RELAY 4

void setup() {
  pinMode(RELAY, OUTPUT);

void loop() {
  //turns Printer on for 10 sec and off for 10 sec
  digitalWrite(RELAY, HIGH);
  digitalWrite(RELAY, LOW);

It looks like it might be an installation issue, or perhaps a library for the ESP32 that is not installed.

My standard device is to load the example "Blink without delay" from file/examples. If this doesn't work you need to google what else might be needed for the ESP32.

I agree with JohnRob that this could be caused by a problem with the ESP32 boards platform. For that reason, I'll recommend that you manually remove and then reinstall it by following these instructions:

Be aware this will remove any boards you have installed via Boards Manager. They are easy enough to reinstall again though.

  1. Select File > Preferences from the Arduino IDE's menus.
  2. Click the link on the line following "More preferences can be edited directly in the file". This will open the Arduino15 folder.
  3. Delete all files and folders under the Arduino15 folder except for the preferences.txt file. Please be very careful when deleting things from your computer. When in doubt, back up!

Now you will need to re-install the ESP32 boards platform you just uninstalled:

  1. Select Tools > Board > Boards Manager from the Arduino IDE's menus.
  2. Wait for the update to finish.
  3. Scroll down through the list of boards platforms until you see "esp32 by Espressif Systems". Click on it.
  4. Click the Install button.
  5. Wait for the installation to finish.
  6. Click the Close button

Now try compiling again.

Tried it and it worked like normal for me. Thanks!

You're welcome. I'm glad to hear it's working now. Enjoy!

Hi Pert, Thank you very much for posting your answer. I had the same issue with these .o files not found during compilation. I uninstalled and reinstalled the board definitions following the clear instructions you provided. It went very smoothly, and it worked. I managed to compile the ChipID program. My chip id was ESP32 Chip model = ESP32-D0WDQ6 Rev 1, This chip has 2 cores, Chip ID: 16285940. I will now move on to trying the Blink program then a more advanced sketch. Thank you again for posting this!

1 Like