Error compiling for board Arduino/Genuino Micro

Hey Friends,

I'm having a very WEIRD issue... I've been working on a sketch, and it's been working along just fine. All the sudden today I started getting this message "Error compiling for board Arduino/Genuino Micro.". At first I thought I had a code issue, although no other details are given.

Now I'm beating my head.

I have tried just building the "Blink" example, same issue.
I have tried building a sketch that only starts serial and prints "hi"
I've tried building a sketch that only has setup and loop methods with no other code
I've tried a new USB cable
I've tried a new USB port
I've tried a new just out of the box Micro that's never even been fired up
I upgraded to the latest 1.8.1 build
I've of course rebooted (multiple times)

Any ideas? I'm feeling a bit stupid trying to figure this one out.

When you encounter an error you will see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS(</> button on the toolbar).

It is possible that you haven't selected the correct serial port or board.

7564768463545r7:
It is possible that you haven't selected the correct serial port or board.

Incorrect serial port will never cause a compilation error, incorrect board selection could though.

pert:
When you encounter an error you will see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS(</> button on the toolbar).

Here is the error messages with all the details I can get it to show.

Arduino: 1.8.1 (Windows 10), Board: "Arduino/Genuino Micro"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\atayl\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\atayl\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\atayl\Documents\Arduino\libraries -fqbn=arduino:avr:micro -vid-pid=0X2341_0X8037 -ide-version=10801 -build-path C:\Users\atayl\AppData\Local\Temp\arduino_build_637758 -warnings=all -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino

Error compiling for board Arduino/Genuino Micro.

pert:
Incorrect serial port will never cause a compilation error, incorrect board selection could though.

I am certain that both the board and serial are correct. I've been building and uploading sketches without any issue for months. It literally stopped working between one upload and the next without even disconnecting the device.

I have also now tried 3 of my nano boards, and 2 other micro's.

Huh, that's not very helpful. Usually I expect to see more output when there's a compilation error. Very strange. It looks like the very first time it runs arduino-builder it has an error so it never even gets to the compiler. I compared the arduino-builder command generated on my system with yours and there is no significant difference.

I would recommend you to try reinstalling Arduino IDE 1.8.1 to see if there is something wrong with the copy of arduino-builder on your system. If that doesn't work try installing Arduino IDE 1.6.13. If that doesn't help let me know and I have one other thing you can try that is really just a shot in the dark but worth a try. Sorry I can't give any better help on this.

Can you think of anything that changed between the IDE working correctly and when it started producing the error? Could there be any issue with the various folders that the arduino-builder command references?

Well I have no idea why, but it started working again! Weird, so weird! Can't think of anything I did, walked away for a bit, came back, pressed compile, presto...

I am, for the first time, trying arduino following the directions from the book that came with it (arduino uno selected and usb serial port.) I also went as far as updating Java as that appeared it could be part of my issue. Here are the error messages I'm getting.

Oh, Mac OSX 10.7.5 2.2 intel core 2 duo, 4 GB 667 ddr2 sdram

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

/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.

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

Any help would be great.

Thanks