Go Down

Topic: Upgrade to Ubuntu 11.10 breaks compiling [SOLVED] (Read 2102 times) previous topic - next topic


Oct 22, 2011, 04:00 am Last Edit: Oct 23, 2011, 07:36 pm by computer_freak_8 Reason: 1
I've upgraded to Ubuntu 11.10 from 11.04, and I can no longer successfully compile code within the Arduino IDE. I've searched around, but haven't found anything that seems specific to my issue. Perhaps I'm just using the wrong terms; I don't know.

When I try to compile the "Bare Minimum" example sketch, here's what I get:
Code: [Select]
In file included from /usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h:44:0,
                from /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/delay.h:37,
                from /home/jaredtbrees/PROGRAMS/Arduino/arduino-0022/hardware/arduino/cores/arduino/wiring_private.h:30,
                from /home/jaredtbrees/PROGRAMS/Arduino/arduino-0022/hardware/arduino/cores/arduino/WInterrupts.c:34:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h:426:15: error: expected identifier or '(' before 'double'
/usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h:426:15: error: expected ')' before '>=' token

When starting the Arduino IDE from the command line, I get the following information:
Code: [Select]
Experimental:  JNI_OnLoad called.
Stable Library
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7

I'm lost at this point.


This rings a bell about double and round. Inside wiring.h at around line 79 is this:

Code: [Select]
#define round(x)     ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))

I believe that conflicts with the definition for round in math.h:

Code: [Select]
double round (double __x) __ATTR_CONST__;

Try commenting out the #define in wiring.h.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics


I had the same problem, search for "Arduino IDE" in Ubuntu Software Center, seems to fix the issue  :)


@Nick Gammon: That looks like it did the trick - thanks!

@GregN: I would use the one in the repositories, but I've had too many other issues with it for me to trust it... yet.

Go Up