Welcome! Log In Create A New Profile

Advanced

Problems to compile sprinter under Ubuntu 11.10

Posted by serych 
Problems to compile sprinter under Ubuntu 11.10
November 27, 2011 07:55AM
Hi there,
I cannot compile Sprinter firmware after upgrade from Ubuntu 10.x to 11.10. Before upgrade all was OK, but now if I run "Verify" command (the play button) in the Arduino 022 or 018 (I tested both), after while it says Error compiling and writes down in the black window:


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 /usr/share/arduino/hardware/Sanguino/cores/arduino/wiring_private.h:31,
from /usr/share/arduino/hardware/Sanguino/cores/arduino/WInterrupts.c:33:
/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 "

If I try just "make" from the terminal window, it says:

cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
/usr/lib/gcc/avr/4.5.3/../../../avr/bin/ld: avr:6 architecture of input file `applet/core.a(wiring.o)' is incompatible with avr:5 output
/usr/lib/gcc/avr/4.5.3/../../../avr/bin/ld: avr:6 architecture of input file `applet/core.a(wiring_analog.o)' is incompatible with avr:5 output
/usr/lib/gcc/avr/4.5.3/../../../avr/bin/ld: avr:6 architecture of input file `applet/core.a(wiring_digital.o)' is incompatible with avr:5 output
/usr/lib/gcc/avr/4.5.3/../../../avr/bin/ld: avr:6 architecture of input file `applet/core.a(HardwareSerial.o)' is incompatible with avr:5 output
/usr/lib/gcc/avr/4.5.3/../../../avr/bin/ld: avr:6 architecture of input file `applet/core.a(Print.o)' is incompatible with avr:5 output
/usr/lib/gcc/avr/4.5.3/../../../avr/bin/ld: avr:6 architecture of input file `applet/core.a(pins_arduino.o)' is incompatible with avr:5 output
/usr/lib/gcc/avr/4.5.3/../../../avr/bin/ld: avr:6 architecture of input file `applet/core.a(WString.o)' is incompatible with avr:5 output
collect2: ld returned 1 exit status
make: *** [applet/Sprinter.elf] Error 1

Does anybody else have similar problems? Any tips, how to solve it?

Thanks

Jakub
Yes...edit /usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h, go to line 426 and insert a line

#undef round

before where 'round' is defined.
mikele
Re: Problems to compile sprinter under Ubuntu 11.10
January 05, 2012 02:40PM
#undef round

did the trick! THX a lot!

Cheers, Mike
I am a new linux user, I am on 11.10, and I get almost the exact same error message as serych's first example.

I am using
Arduino core 0022
Arduino-0022
Sanguino-0018r2_1_4
kliment-Sprinter-a352585

Sanguinololu v1.3a w/Amega644p

I have also tried the sanguino-0023, and the arduino-0018, with similar results.

When I try to mount Sprinter.pde 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/jeppe/RepRap/arduino-0022/hardware/Sanguino/cores/arduino/wiring_private.h:31,
from /home/jeppe/RepRap/arduino-0022/hardware/Sanguino/cores/arduino/WInterrupts.c:33:
/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


Problem is I can't edit the "/usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h"

It says i'm not the owner....

I am on a fresh ubuntu install on my own computer. How come I cant get permission to alter the file?
Please keep in mind that I've bee a linux user for 3 days.... Maybe I'm missing something reeeally obvious.

Thanks
DeuxVisNotLoged
Re: Problems to compile sprinter under Ubuntu 11.10
January 19, 2012 11:52AM
type this in a terminal :

sudo gedit /usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h


and enter your password when asked
Fredd6
Re: Problems to compile sprinter under Ubuntu 11.10
January 20, 2012 02:50PM
Hello! I added #undef round to /usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h
Resulting in math.h (lines 425 - 430):
*/
extern double round (double __x) __ATTR_CONST__;
#undef round
#define roundf round /**< The alias for round(). */

/**


After that i did a restart to my laptop (with Ubuntu 11.10).
Opened Arduino IDE, from menu: Tools -> Board -> ATTiny85 (Arduino as ISP)
Loaded Blink example, changed pin 13 to 3 and tried to upload.

Got these errors:
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/x/sketchbook/hardware/attiny45_85/cores/attiny45_85/wiring_private.h:32,
from /home/x/sketchbook/hardware/attiny45_85/cores/attiny45_85/WInterrupts.c:36:
/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


BTW! I have Arduino Duemilanove, so NO capacitor between GND and reset... or anything was used.
For Fredd6....I think that you have to write the next sentence in this order:

#undef round
extern double round (double __x) __ATTR_CONST__;
#define roundf round /**< The alias for round(). */
very useful thanks.
I was getting the same error, but after adding the #undef round line, I get a new error:
/usr/bin/avr-gcc -mmcu=atmega2560 -I. -gstabs -DF_CPU=16000000 -I/home/doktorj/Downloads/Hacking/Arduino/arduino-0023/hardware/arduino/cores/arduino -Os -Wall -Wstrict-prototypes -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -w -ffunction-sections -fdata-sections -DARDUINO=22 -Wl,--gc-sections -o applet/Sprinter.elf applet/Sprinter.cpp -L. applet/core.a -lm
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr6/crtm2560.o: In function `__bad_interrupt':
../../../../crt1/gcrt1.S:195: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [applet/Sprinter.elf] Error 1


Any ideas? This is making me crazy. After finally getting my Prusa Mendel built, I've spent the last 3 days unable to even power it on, since I can't compile the firmware.
Never mind. After redownloading everything and downgrading to Arduino 022 it works properly.
Timothy Tuck
Re: Problems to compile sprinter under Ubuntu 11.10
June 26, 2012 09:38PM
RobertB Wrote:
-------------------------------------------------------
> Yes...edit
> /usr/lib/gcc/avr/4.5.3/../../../avr/include/math.h
> , go to line 426 and insert a line
>
> #undef round
>
> before where 'round' is defined.

Thank you kind Sir,
That resolved the issue and at least now It compiles.. Now on to the Next error, actually getting it to upload.
Hopefully the rest is easier to resolve than this one was.
Thanks again for sharing.
Tnt
Re: Problems to compile sprinter under Ubuntu 11.10
June 27, 2012 03:19AM
My broken record says: "For using Arduino IDE 1.0 as well as recent gcc compilers the Sanguino extensions are of no use, you have to install Gen7 Arduino IDE Support 2.0 instead." smiling smiley


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Sorry, only registered users may post in this forum.

Click here to login