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

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

Re: [avr-gcc-list] undefined reference to `__divmodqi4'


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] undefined reference to `__divmodqi4'
Date: Tue, 7 Jan 2003 14:18:48 +0100 (MET)

"Guglielmo D." <address@hidden> wrote:

> I compile like this:
> 
> $ avr-gcc -c test.c
> $ avr-ld test.o -o testing -mavr23xx

Sure.  That cannot work.  If you prefer to execute the link command
manually, you need to execute it with all the required arguments.  So
far, you forgot to at least specify the respective crtX.o file and the
libraries (-lc).  The use of -mavr23xx is also no longer the
recommended way.  (But perhaps it still is in your old version of the
tools, i don't know.  That's another advantage of the approach below,
it'll automagically handle all this for you.)

Better use the compiler to organize linking for you:

$ avr-gcc -o testing -o test.o

Normally, you should also specify the -mmcu= option that matches your
device (like -mmcu=at90s2333).  It's only this very minimalistic
example that works without it (it will silently assume -mmcu=avr2).

If you add a -v option to the above command line, you'll see the
arguments gcc is using to call the linker.

Btw., you should better upgrade to more recent versions of the tools.
A number of bugs have been fixed since, and the documentation has
almost been brought up-to-date now.

-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/
avr-gcc-list at http://avr1.org



reply via email to

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