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

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

[avr-gcc-list] Undefined reference - Why?


From: Bernt Hustad Hembre
Subject: [avr-gcc-list] Undefined reference - Why?
Date: Sun, 4 Mar 2001 16:05:27 +0100 (CET)

Hi.

I have some problems with this litle code-piece

---- start test.c ----

#include <math.h>

void    a_function(int tall);

int main(void){ 
        int      hoyde;
        double trykk;

        hoyde           = pow(2,2);
        a_function(hoyde);
//      trykk = hoyde * 1.234;

        return 0;
} /* main */

        
void    a_function(int tall){
}

---- end test.c ----

This is what happends:


M:\prosjekt\tuger\hw\firmware>make
make: *** Warning: File `tuger.c' has modification time in the future
(2001-03-0
4 15:58:04 > 2001-03-04 15:55:54)
avr-gcc -c -g -O3 -Wall -Wstrict-prototypes -Wa,-ahlms=tuger.lst
-mmcu=at90s4433
 -I. tuger.c -o tuger.o
tuger.c: In function `main':
tuger.c:8: warning: unused variable `trykk'
avr-gcc  tuger.o   -Wl,-Map=tuger.map,--cref -mmcu=at90s4433 -o tuger.elf
tuger.o: In function `main':
M:\prosjekt\tuger\hw\firmware/tuger.c:10: undefined reference to `pow'
make: *** [tuger.elf] Error 1


But if I change this:

        a_function(hoyde);
//      trykk = hoyde * 1.234;

to this:

//      a_function(hoyde);
        trykk = hoyde * 1.234;

It compiles without any errormessages...

Version:
M:\prosjekt\tuger\hw\firmware>avr-gcc --version
2.97

Installed on a Win2000 5.00.2195
Installed using the file
http://www.avrfreaks.com/AVRGCC/Download/avrgcc20010211.exe
(Gunnar Henne's distibution).

Any suggestions?


Bernie
Tlf.: 92648923
address@hidden




reply via email to

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