Bug #17312 2010-06-29 16:57
martonmiklos
avr-gcc linking fails due the wrong -L argument
Hello all,
I am try to build a simple program which is using eeprom rutines from the avr-libc.
The codeblocks links it with:
avr-g++ -L/usr/lib/avr/lib -o bin/avr.elf .objs/adc.o .objs/global.o .objs/i2c.o .objs/main.o .objs/motor.o .objs/serial.o .objs/servo.o
And it fails with:
undefined reference to __eerd_byte_m32
If I remove the -L/usr/lib/avr/lib argument and run it from command line it links fine.
The reason of the error is that there is a libc.a file in the /usr/lib/avr/lib directory which contains the libc library for the Attiny2313, but the Atmega32's libraries are in the /usr/lib/avr/lib/avr5 and the linker does not find it automatically.
The removing of the -L[default path] argument from the linking process would solve the problem.
- Category
- Compiler
- Group
- Status
- Open
- Close date
- Assigned to