avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Unable to link using libm.a and libc.a


From: Georg-Johann Lay
Subject: Re: [avr-gcc-list] Unable to link using libm.a and libc.a
Date: Sat, 13 Apr 2013 16:45:58 +0200
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

Sean schrieb:
I've been attempting to compile and link an Ada programme for the Arduino.

I have managed to get a simple programme compiled linked and running on an AtMega328p board. But when I start to use some of the more complex functions I obviously had to start using avrlibc.

I've down loaded and built avrlibc and I have then attempted to link my programme. But no matter how I try to tell the compiler/linker to
use libc or libm I keep getting link issues:

avr-gnatbind --RTS=C:\GNAT\2012\lib\gcc\avr\4.5.4\rts-zfp -nostdlib -I- -x C:\Arduino\Arduino_Ada\BMP085\obj\main.ali

avr-gnatlink C:\Arduino\Arduino_Ada\BMP085\obj\main.ali C:\Arduino\Arduino_Ada\BMP085\\obj\crtm328p._o -nostdlib -lgcc -lc -lm -mavr5 -Tdata=0x00800200 -mmcu=avr5 -g -nostdlib C:\avr-ada-1.2.0_bin\avr\onewire\lib\libonewire.a C:\avr-ada-1.2.0_bin\avr\debug\lib\libdebug.a C:\avr-ada-1.2.0_bin\avr\crc

Why are you -nostdlib? The missing functions below are standard functions from libc / libgcc.


[...] undefined reference to `memcmp'
[...] undefined reference to `itoa'
[...] undefined reference to `__udivmodqi4'
[...] undefined reference to `__udivmodhi4'
[...] many more

Also make sure that the libraries are fitting the compiler version, see the 4.7 release notes.

http://gcc.gnu.org/gcc-4.7/changes.html

Johann



reply via email to

[Prev in Thread] Current Thread [Next in Thread]