[Top][All Lists]

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

Re: [avr-gcc-list] link problems

From: Christof
Subject: Re: [avr-gcc-list] link problems
Date: Tue, 08 Mar 2005 14:37:44 +0100
User-agent: Mozilla Thunderbird 1.0 (X11/20050116)

address@hidden schrieb:
Dear All,

I have installed binutils-2.15 (configuring with --prefix=/usr --target=avr
--program-prefix="avr-"), gcc-3.4.3 (same configure options plus
--enable-languages=c) and avr-libc-1.2.3 (with doconf --prefix=/usr
--target=avr). I am running a fedora-core3.

When I try to build a simple example program, it compiles fine (wiht avr-gcc -g
 -mmcu=atmega8 leds.c -c -o leds), but then it seems that gcc is not able to
link libc: when I try avr-gcc -g -mmcu=atmega8 leds.c -o leds
I get:
/home/enrico/led/leds.c:12: undefined reference to `cli'
/tmp/cc0lcrTb.o(.text+0x16):/home/enrico/led/leds.c:14: undefined reference to
/tmp/cc0lcrTb.o(.text+0x24):/home/enrico/led/leds.c:15: undefined reference to
/tmp/cc0lcrTb.o(.text+0x32):/home/enrico/led/leds.c:17: undefined reference to
/tmp/cc0lcrTb.o(.text+0x56): In function `test':
/home/enrico/led/leds.c:29: undefined reference to `outp'

any idea what the problem could be?
The linker complains that it cannot find outp.
This is because functions like outp, inp, sbi, cbi are no longer supported. I/O-Registers are directly accesible through their names, so you can easily write:

PORTB = 0xff;

for example. Look for "Special function registers" in the avr libc documentation.

Christof Kr├╝ger

reply via email to

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