Arduino not compiling

HEY,
I am using 1.8.19 version of Arduino Uno on MacBook .
this is the error message coming every time I compile

Arduino: 1.8.19 (Mac OS X), Board: "Arduino/Genuino Uno"

fork/exec /Users/sumitdhawan/Library/Arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++: bad CPU type in executable
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Please help.

Please read and check.

Hi @vdvivaan08. Hi @rflt. The cause of the error is that the compiler you are using is a 32-bit application.

Support for such applications was dropped starting from macOS Catalina:

The reason you are experiencing this problem is that you are using an extremely outdated version of the "Arduino AVR Boards" platform that adds support for the Arduino Uno board to Arduino IDE. At the time that version was made, macOS still supported 32-bit applications and so it was sensible for Arduino to use a 32-bit build of the compiler.

Later when Apple dropped support for 32-bit applications, Arduino made a new release of the platform that uses a 64-bit build of the compiler. So the solution is for you to update your "Arduino AVR Boards" installation to a modern version, which will also update the compiler to the 64-bit version. I'll provide instructions you can follow to do that:

  1. Select Tools > Board > Boards Manager from the Arduino IDE menus.
    A "Boards Manager" dialog will appear.
  2. Wait for the updates to finish, as shown by the messages printed at the bottom of the "Boards Manager" dialog.
  3. Scroll down through the list of boards platforms until you find the "Arduino AVR Boards" entry. Click on it.
    Some buttons will appear on the entry.
  4. Click the "Update" button on the "Arduino AVR Boards" entry.
  5. Wait for the update to finish.
  6. Click the "Close" button on the "Boards Manager" dialog.

Now try compiling your sketch again. Hopefully this time there won't be any errors.

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