Problem with compiling... Mac + Arduino

Hello everybody!

I have a Mac (OSX 10.7.5) and an Arduino Uno. Everything looks okay in my eyes but can't get it work.
When I try to compile any basic example program I get error like this:

/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld: /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so: error loading plugin: dlopen(/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so, 2): Symbol not found: _environ

  • Referenced from: /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so*
  • Expected in: /usr/lib/libSystem.B.dylib*
    collect2: error: ld returned 1 exit status
    exit status 1
    Error compiling for board Arduino/Genuino Uno.

Any idea what to do? I have already reinstalled and some other basic stuff.
All ideas what to test or do next are welcome. Thank you in advance for all hints.

This issue has been reported here regularly here since the release of Arduino AVR Boards 1.6.12 (bundled with Arduino IDE 1.6.10). It is caused by an LTO (link time optimization) plugin added in that version. I don't believe the cause has ever been found. I can only offer some workarounds:

Option 1: Follow these instructions to revert to the pre-LTO Arduino AVR Boards package:

  • Tools > Board > Boards Manager
  • Wait for downloads to finish
  • Click on "Arduino AVR Boards"
  • Select 1.6.11 from the "select version" drop down menu.
  • Click the "Install" button.
  • Wait for installation to finish.
  • Click the "Close" button.

OR

Option 2: Use the Arduino Web Editor:
Arduino Cloud.
More information here:
Getting Started with Arduino Web Editor on Various Platforms - Arduino Project Hub

Super! Thank you, Sir!
It works great! Problem solved :slight_smile:

I know that this is kind of well known issue but believe me, I just could not find any (for me) understandable... This is the best.
Thanks!

(prepare for more questions!)