Upgrade to Ubuntu 11.10 breaks compiling [SOLVED]

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:

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:

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:

#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:

double round (double __x) __ATTR_CONST__;

Try commenting out the #define in wiring.h.

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

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