Status bar warns “Error compiling.” and console is empty

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:

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.

stopped working.jpg

To the moderator.
Although this topic is not entirely out of place in this forum, probably "Installation & Troubleshooting" is a better place. I am content with either (but not both ;))

Try this:
File:Preferences, check the verbose boxes, see if you get more details.

I wrote: "It has been suggested to turn on verbose output during compilation in the IDE preferences". I forgot to state explicitly that I did just that. But that is the way I found the commands to execute in a command window. I did state that I got no error messages from the command window.

I've not seen the IDE stutter along line by line like that. Not even sure where to start :astonished:

janeppo:
To the moderator.
Although this topic is not entirely out of place in this forum, probably "Installation & Troubleshooting" is a better place. I am content with either (but not both ;))

Thanks for the extremely detailed report. I think it is however an installation issue - sort of. I'll move it there.

There have been other similar reports of the "Error compiling" nature, with nothing resolved that I am aware of.

My gut feeling is "Windows 8!".

But really I have no proof.

Is G: a hard disk or network drive?

Does the folder you installed into have proper write permissions?

My other suggestion is to use IDE 1.0.5, not 1.5.2

The IDE 1.5.2 comes with this warning:

WARNING: This software is a beta version, you may encounter bugs or unexpected behaviours. Please discuss any issues in the Due forum

Reply to Nick Gammon

G: is an internal hard disk with user libraries. All but one (the fresh 1.0.5) arduino IDEs are installed in My Documents, so write permissions are not a problem.

I followed your suggestion about 1.0.5. It comes with a self installing package and/or a zip file. I downloaded the self installing package. It installs in C:\Program Files (x86)\Arduino.

I followed the moderator's suggestion and turned on verbose output from the beginning. I compiled BareMinimum. It stops with "Error compiling." Obviously, the console window is not empty now, but there are no error messages, only warnings. A grabbed window is attached below. Compilation advances a bit further, and there are some warnings that I did not see in other versions. Here is the complete console output of the first compilation of this IDE (with some abbreviations in view of the max 9500 characters allowed for a post). On recompilation in the IDE, the console seems to always (i.e. at least 5 times) stop at the compilation of malloc.c. The first compilation has one more line, with the compilation of realloc.c. Compiling realloc.c in a command window with administrator permission does not help. There are no error messages.

So, essentially: In Arduino IDE 1.0.5: Status bar warns "Error compiling." and console contains no error messages.

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\variants\standard C:\Users\JANEPP~1\AppData\Local\Temp\build8970373888206397965.tmp\BareMinimum.cpp -o C:\Users\JANEPP~1\AppData\Local\Temp\build8970373888206397965.tmp\BareMinimum.cpp.o 
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\avr-libc\malloc.c -o C:\Users\JANEPP~1\AppData\Local\Temp\build8970373888206397965.tmp\malloc.c.o 
avr-gcc realloc.c
avr-gcc WInterrupts.c
avr-gcc wiring.c
avr-gcc wiring_analog.c
avr-gcc wiring_digital.c
avr-gcc wiring_pulse.c
avr-gcc wiring_shift.c
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\CDC.cpp -o C:\Users\JANEPP~1\AppData\Local\Temp\build8970373888206397965.tmp\CDC.cpp.o 
avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp -o C:\Users\JANEPP~1\AppData\Local\Temp\build8970373888206397965.tmp\HardwareSerial.cpp.o 
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp: In function 'void store_char(unsigned char, ring_buffer*)':
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp:98: warning: comparison between signed and unsigned integer expressions
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp: In function 'void __vector_18()':
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp:127: warning: unused variable 'c'
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp: In member function 'void HardwareSerial::begin(long unsigned int, byte)':
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp:368: warning: unused variable 'current_config'
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp: In member function 'virtual size_t HardwareSerial::write(uint8_t)':
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp:467: warning: comparison between signed and unsigned integer expressions
avr-g++ HID.cpp
avr-g++ IPAddress.cpp
avr-g++ main.cpp
avr-g++ new.cpp
avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\Print.cpp -o C:\Users\JANEPP~1\AppData\Local\Temp\build8970373888206397965.tmp\Print.cpp.o 
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\Print.cpp: In member function 'size_t Print::print(const __FlashStringHelper*)':
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\Print.cpp:44: warning: '__progmem__' attribute ignored
avr-g++ Stream.cpp
avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\Tone.cpp -o C:\Users\JANEPP~1\AppData\Local\Temp\build8970373888206397965.tmp\Tone.cpp.o 
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\Tone.cpp:119: warning: only initialized variables can be placed into program memory area
avr-g++ USBCore.cpp
avr-g++ WMath.cpp
avr-g++ WString.cpp
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-ar rcs C:\Users\JANEPP~1\AppData\Local\Temp\build8970373888206397965.tmp\core.a C:\Users\JANEPP~1\AppData\Local\Temp\build8970373888206397965.tmp\malloc.c.o 
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-ar rcs C:\Users\JANEPP~1\AppData\Local\Temp\build8970373888206397965.tmp\core.a C:\Users\JANEPP~1\AppData\Local\Temp\build8970373888206397965.tmp\realloc.c.o

Reply to Nick Gammon

You wrote

There have been other similar reports of the "Error compiling" nature, with nothing resolved that I am aware of.

I would appreciate having specific pointers to those other reports.

Also, more generally, I'm interested in reports of Windows x64 without this IDE problem.

http://forum.arduino.cc/index.php?topic=179542.0

http://forum.arduino.cc/index.php?topic=179513.0

http://forum.arduino.cc/index.php?topic=169998.0

I stopped looking after that, but skim back through the "Installation & Troubleshooting" section.

Thanks for answering.

179542 does mention an error message, however obscure: internal compiler error
179513 is on a Mac and mentions a problem with cc1plus; this might be related to my problem
169998 is already on the list in my first post

I did scan a bit for older posts but found none.

I got around 12000 hits from Google for:

arduino "error compiling" message

Probably not all relevant, but some might be.

That's a hay stack. I'm looking for the needle (no error information).

Just for now, I continue with version 1.0.5. I have Data Execution Prevention switched OFF. The Windows log files show some additional info.

I compile the BareMinimum sketch. Then the Windows Application log has 4 new entries: Application error, Windows Error Reporting, Application Error, Windows Error Reporting. Sadly, they are in Dutch. The are reports of two incidents (access violation) with identical signature:

P1: avr-gcc.exe
P2: 0.0.0.0
P3: 49383f11
P4: browse~1.dll
P5: 2.6.1339.144
P6: 51ac6848
P7: c0000005
P8: 0015c6d3
P9: 
P10:

The paths are

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc.exe
c:\progra~3\browse~1\261339~1.144\{c16c1~1\browse~1.dll

There is an old (2010) topic on the Arduino IDE on 64 bit systems. Several posts state having no problems with Windows 64 bit systems. That's an answer to one of my questions.

Exception 0000005 (Access violation) can be caused by faulty memory. However, I do not think that is the case, because this system is about as stable as one can expect from an average Windows system. Also, the error signature itself in the log file is exactly reproducible, even after restarting the IDE.

As for the other versions of the IDE: I read several different error signatures in the log files. Summarized: they al have exception code 0000005, but the applications causing them are also avr-ar.exe, arduino.exe, as.exe. The module is always browse~1.dll

Strangely, there is one other error entry, where C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\UWA\UpdaterStartupUtility.exe causes exception 0000005 and the module is also browse~1.dll (but with a different path: c:\progra~3\browse~1\261339~1.144{c16c1~1\browse~1.dll)

Have you tried right-clicking on the Arduino icon, and changing the program's properties under "Compatibility" settings... so that it's compatible with Windows XP and also it's "run as Administrator"?

I had the same problem, tried the above, and it resolved my problem. (I think). (At least for the rest of this afternoon today). This was happening to me on Windows 8 only. Never had any problems before on my Windows 7 machine.

Thanks, that solves my problem.

If 'Compatibility mode' is set to Windows XP, Vista or even 7, then the BareMinimum sketch compiles without problem in the Arduino IDE for versions 1.0.4, 1.0.5, 1.5.2 and the nightly build of July 28, 2013.

'Execute as administrator' makes no difference at all.

If you are having this problem while running Windows 8, refresh your system. I know it's a pain in the behind but it worked for me.

Hey, i guess this worked out the equations, at least,in my 'Windows 8 Single language' platform:
mouse right click on exec icon, go to property, then security tab and use compatibility mode; select windows XP, service pack 3;
i run arduino as administrator too.
hope that helps!

I had the same problem as Janeppo and it got fixed for me too by changing the compatibility mode option (Windows XP service pack 3 or Windows 7 works for me). I'm running Windows 7 and have an Arduino Due board which was working fine till sometime ago. I think the latest Windows 7 update screwed things up. Note to moderator: I think this information of running the IDE in the correct compatibility mode should be up somewhere prominent as I think many users are likely to face this problem.