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

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

Re: [avr-gcc-list] math linking problem even with -lm


From: E. Weddington
Subject: Re: [avr-gcc-list] math linking problem even with -lm
Date: Tue, 21 Jun 2005 14:28:31 -0600
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Andrew McNabb wrote:

I'm using the math library for the first time, but the compiler doesn't
seem to like what I'm doing.  I was smart enough to put "-lm" in the
linker flags, and I even added "-L/usr/avr/lib" just in case, but that
still didn't help.  /usr/avr/lib/libm.a definitely exists, and it
includes sin.o.  I'm sure I'm still doing something dumb.  Does anyone
know what could be happening?  Thanks in advance.

avr-gcc -mmcu=atmega8 -lm -L/usr/avr/lib  sound1.o   -o sound1
sound1.o: In function `__vector_8':
sound1.c:(.text+0xac): undefined reference to `sin'
make: *** [sound1] Error 1


Did you try using MFile to generate a makefile for your project?:
<http://www.sax.de/~joerg/mfile/>

If you're using WinAVR, then MFile comes with it. Or you can use the WinAVR Makefile Template and modify it for your project.

The WinAVR Makefile Template and the Makefile generated by MFile (which uses the WinAVR Makefile Template) automatically setup a lot of these things for you including stuff like the math library.

HTH
Eric




reply via email to

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