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
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list