Hi,
I am new to arduino and I am just trying the example sketch "Blinking Led"
const int LED = 13; //led connected to digital pin 13
void setup()
{
pinMode(LED, OUTPUT); //sets teh digital pin as output
}
void loop() {
digitalWrite(LED, HIGH); //turns the led on
delay(1000); //waits for a second
digitalWrite(LED, LOW); //turns the led off
delay(1000); //waits for a second
}
I get the following error:
/Applications/Arduino 3.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld: /Applications/Arduino 3.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so: error loading plugin: dlopen(/Applications/Arduino 3.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 3.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.
I am using a Mac with OSX 10.7.5 and Arduino 1.8.5
Any suggestions to solve this?
pert
January 30, 2018, 2:26pm
2
The problem is that your version of OSX is too old for the version of Arduino AVR Boards you're using:
opened 01:13PM - 02 Jan 18 UTC
Type: Bug
OS: OSX
Component: Toolchain
See below for a full log and the error message. It seems ld completely fails, th… is was while compiling the Blink example, using Arduino 1.8.5. I considered trying the beta build, but that says it needs Mountain Lion (10.8) or higher.
Unfortunately, this was not on my own machine (but someone in a workshop today), so I do not have access to this machine for further testing.
@per1234 previously [suggested to downgrade the AVR boards](https://forum.arduino.cc/index.php?topic=419631.msg2889902#msg2889902) to 1.6.11, which does not have LTO support, which worked on this machine too.
Here's another mention of this issue: https://www.reddit.com/r/arduino/comments/56yn3b/zero_experience_guy_needs_help_im_brand_new_to/
[This issue](https://github.com/pyinstaller/pyinstaller/issues/1191#issuecomment-150872663) suggests this is because the application is compiled for a too new OSX version. [This issue](https://github.com/kakaroto/SWProxy/issues/65) suggests a too old XCode version (but I couldn't try installing or upgrading Xcode).
```
/Users/leo/Desktop/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Users/leo/Desktop/Arduino.app/Contents/Java/hardware -tools /Users/leo/Desktop/Arduino.app/Contents/Java/tools-builder -tools /Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Users/leo/Desktop/Arduino.app/Contents/Java/libraries -libraries /Users/leo/Documents/Arduino/libraries -fqbn=arduino:avr:uno -vid-pid=0X2A03_0X0043 -ide-version=10805 -build-path /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439 -warnings=none -build-cache /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_cache_189914 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/leo/Desktop/Arduino.app/Contents/Java/examples/01.Basics/Blink/Blink.ino
/Users/leo/Desktop/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Users/leo/Desktop/Arduino.app/Contents/Java/hardware -tools /Users/leo/Desktop/Arduino.app/Contents/Java/tools-builder -tools /Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Users/leo/Desktop/Arduino.app/Contents/Java/libraries -libraries /Users/leo/Documents/Arduino/libraries -fqbn=arduino:avr:uno -vid-pid=0X2A03_0X0043 -ide-version=10805 -build-path /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439 -warnings=none -build-cache /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_cache_189914 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/leo/Desktop/Arduino.app/Contents/Java/examples/01.Basics/Blink/Blink.ino
Using board 'uno' from platform in folder: /Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr
Using core 'arduino' from platform in folder: /Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr
Detecting libraries used...
"/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/sketch/Blink.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/sketch/Blink.ino.cpp" -o "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/preproc/ctags_target_for_gcc_minus_e.cpp"
"/Users/leo/Desktop/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/preproc/ctags_target_for_gcc_minus_e.cpp"
Sketch aan het compileren...
"/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/sketch/Blink.ino.cpp" -o "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/sketch/Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring_pulse.S.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/WInterrupts.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/hooks.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring_analog.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring_digital.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring_pulse.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/wiring_shift.c.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/CDC.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/HardwareSerial.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/HardwareSerial0.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/HardwareSerial1.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/HardwareSerial2.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/HardwareSerial3.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/IPAddress.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/PluggableUSB.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/Print.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/Stream.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/Tone.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/USBCore.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/WMath.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/WString.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/abi.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/main.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/new.cpp.o wordt gebruikt.
Vorige gecompileerde bestand /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/core.a wordt gebruikt.
Archiving built core (caching) in: /var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_cache_189914/core/core_arduino_avr_uno_75de3b8f51153cc6fc37d8d7716786a8.a
Linking everything together...
"/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/Blink.ino.elf" "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/sketch/Blink.ino.cpp.o" "/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439/core/core.a" "-L/var/folders/cf/jfpxcrl96dd1rzbkqcvwx6_h0000gp/T/arduino_build_434439" -lm
/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld: /Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so: error loading plugin: dlopen(/Users/leo/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so, 2): Symbol not found: _environ
Referenced from: /Users/leo/Desktop/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
Fout bij het compileren voor board Arduino/Genuino Uno
```
You have two options: Update your OSX or use an older version of Arduino AVR Boards.
Here's how to do the latter:
Tools > Board > Boards Manager
Wait for the download to finish
Click on Arduino AVR Boards
Select "1.6.11" from the "select version" drop down menu"
Click "Install"
Wait for installation to finish
Click "Close"
This is related to a compiler update in Arduino AVR Boards 1.6.12, that's why installing 1.6.11 will fix it. You will need to avoid upgrading to any Arduino AVR Boards version above 1.6.11.