Introduction
Recently I tried to use my Arduino Uno R3 with a new PC, with Windows 8 x64. I got stuck because of an error with no further information. So I Googled, read the troubleshooting guide (http://arduino.cc/en/Guide/Troubleshooting), searched the forums and read "How to use this forum" (How to use this forum - please read - Website and Forum - Arduino Forum).
I did not find an answer. But I think I found several other topics with the same problem and outward appearance, although there might very well be different causes. The oldest dates from June 3, 2013. The topics are:
- PhyberLogik: I keep getting "Error compiling." when trying to upload sketches (I keep getting "Error compiling." when trying to upload sketches - IDE 1.x - Arduino Forum)
- lacrisostomo: "Error Compiling Arduino UNO R3" ("Error Compiling Arduino UNO R3" - Programming Questions - Arduino Forum)
- ArduinoLord32: "Error Compiling." On Blink example?! ("Error Compiling." On Blink example?! - Interfacing w/ Software on the Computer - Arduino Forum)
- Komang: Message says "Error compiling" on my first example Program (Message says "Error compiling" on my first example Program - Project Guidance - Arduino Forum)
- hiranaqvi123: Re: Message says "Error compiling" on my first example Program (Re: Message says "Error compiling" on my first example Program - IDE 1.x - Arduino Forum)
- erikaabyholm: Trouble with compiling.. (Trouble with compiling.. - IDE 1.x - Arduino Forum)
Description of the problem
My minimal example is as follows. In the Arduino 1.5.2 IDE load the “BareMinimum” example from 01.Basics and compile it with the Ctrl+ R keyboard shortcut. The green progress bar then advances halfway, stops and after a second or so the status bar color changes to orange with the message: “Error compiling.” The black console window below it remains empty. A picture "Error compiling.jpg" is attached.
For me, this happens with any sketch, any target Arduino board and with Arduino software versions 1.0.4, 1.5.1r2, 1.5.2 and the nightly build of July 16, 2013. All of the above 6 topics appear to use MS Windows, and most of them appear to use a 64 bit version.
Obviously, compilation of the BareMinimum sketch should not result in an “Error compiling.” message. The lack of further information makes it hard to find the real stumbling block.
Things I tried
In the above topics the following remedies are suggested:
- Reinstall the arduino software
- Insert a top line with: #include <Arduino.h>
- Check for specific missing files or directories
PhyberLogik, hiranqvi123 and erikaabyholm state that reinstalling the software does not help. For me, none of these suggestions help.
Also, I tried executing the IDE as an administrator. This did not help.
Further details (rather long and boring)
It has been suggested to turn on verbose output during compilation in the IDE preferences. This copies the commands being executed to the console window. The last command might be the one that gives an error. We can execute it in a command window as an ordinary user or as administrator and watch for error messages.
It is impossible to show reproducible results here even if I make a fresh start of the IDE. The reason is, that the console output many times seems to be incomplete. That is, the last command shown in the console is not always the command that caused the error.
Anyway, compilation of the BareMinimum sketch in the IDE now results in the following output in the console window (with the orange status line: Error compiling.):
G:\Users\janeppo\Documents\arduino-1.5.2\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=152 -IG:\Users\janeppo\Documents\arduino-1.5.2\hardware\arduino\avr\cores\arduino -IG:\Users\janeppo\Documents\arduino-1.5.2\hardware\arduino\avr\variants\standard C:\Users\JANEPP~1\AppData\Local\Temp\build7122743676165932017.tmp\BareMinimum.cpp -o C:\Users\JANEPP~1\AppData\Local\Temp\build7122743676165932017.tmp\BareMinimum.cpp.o
When I paste this in an administrator command window it just executes with no problem at all. Recompilation of the BareMinimum sketch in the IDE now stops at a different command (there are preceding commands that succeed):
G:\Users\janeppo\Documents\arduino-1.5.2\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=152 -IG:\Users\janeppo\Documents\arduino-1.5.2\hardware\arduino\avr\cores\arduino -IG:\Users\janeppo\Documents\arduino-1.5.2\hardware\arduino\avr\variants\standard G:\Users\janeppo\Documents\arduino-1.5.2\hardware\arduino\avr\cores\arduino\hooks.c -o C:\Users\JANEPP~1\AppData\Local\Temp\build7122743676165932017.tmp\hooks.c.o
Execution of this command in the command window stops with a Windows message (Translation from Dutch): “As.exe stopped working”. After accepting this message and re-executing the command in the command window there is no problem and recompilation in the IDE stops at the command (abbreviated):
avr-gcc malloc.c
After executing this (unabbreviated) in the command window, recompilation in the IDE stops at:
avr-g++ BareMinimum.cpp
After executing this in the command window, recompilation in the IDE stops at:
avr-gcc WInterrupts.c
After executing this in the command window, recompilation in the IDE stops at:
avr-g++ BareMinimum.cpp
After executing this in the command window, recompilation in the IDE stops at (yes, this is identical, even unabbreviated):
avr-g++ BareMinimum.cpp
After executing this in the command window, recompilation in the IDE stops at:
avr-gcc wiring.c
After executing this in the command window, recompilation in the IDE results in (this time, as an example, I give ALL of the console lines in abbreviated form):
avr-g++ BareMinimum.cpp
Using previously compiled: C:\Users\JANEPP~1\AppData\Local\Temp\build7122743676165932017.tmp\hooks.c.o
Using previously compiled: C:\Users\JANEPP~1\AppData\Local\Temp\build7122743676165932017.tmp\malloc.c.o
Using previously compiled: C:\Users\JANEPP~1\AppData\Local\Temp\build7122743676165932017.tmp\WInterrupts.c.o
Using previously compiled: C:\Users\JANEPP~1\AppData\Local\Temp\build7122743676165932017.tmp\wiring.c.o
avr-gcc wiring_analog.c
avr-gcc wiring_digital.c
avr-gcc wiring_pulse.c
avr-gcc wiring_shift.c
avr-g++ CDC.cpp
avr-g++ HardwareSerial.cpp
Executing the last command (i.e. compile HardwareSerial.cpp
) in the command window leads to a Windows 8 message: "cc1plus.exe stopped working" (translated from Dutch). A screenshot is attached. After accepting this message all (that is at least 5) re-executions in the command window lead to the same error message. No further progress seems possible.
Reproducibility
After restarting the IDE compilation of BareMinimum stops at hooks.c
.
Immediate recompilation (i.e. using the IDE and not the command window) stops again at hooks.c
. A second immediate recompilation stops at BareMinimum.cpp
. Successive recompilations randomly stop at either of these two commands.
After compiling hooks.c
in a command window, IDE compilation randomly stops at malloc.c
or hooks.c
or BareMinimum.cpp
.
And so on, via compiling malloc.c
, Winterrupts.c
, wiring.c
in a command window, until finally HardwareSerial.cpp
cannot be compiled in the command window, because of a consistent error message “cc1plus.exe stopped working”.
After again restarting the IDE, compiling in the IDE always stops at compiling BareMinimum.cpp
and no further progress can be made. After switching to the Nano board in the IDE preferences, compiling in the IDE stops at compiling hooks.c
and progress probably could be made. I did not investigate further.
Cc1plus.exe has stopped working
Googling for “cc1plus.exe stopped working” gives one possible hit mingw - "cc1plus.exe has stopped working" while compiling Boost Spirit code - Stack Overflow where compilation fails with no error message. A common trait is a 64 bit Windows and GCC. At this level of detail however I do not know how to proceed.
Environment variables
My Path variable is %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\
I have Java jre7 installed, with CLASSPATH .;C:\Program Files (x86)\Java\jre7\lib\ext\QTJava.zip
Please help
I am eager to get some help with this problem. Where should I look?
Of course, I can just give up. I have several Arduino’s working with another PC with Windows Vista, 32 bit. If this is just a random problem affecting but a few users it is probably not worth the effort.