Mail Archives: djgpp/1996/01/11/02:29:31
Gruess Dich!
> When compiling the following program with djgpp for dos
> 
> #include<math.h>
> void main (void)
> {
> 
> double d , n ;
> d = 40.05 ;
> n = sin ( d ) ;
> 
> }
> 
> with the command: gcc -lm sin.c
> I get the following error message:
> 
> sin.c(.text+0x20): undefined reference to 'sin'.
I 've just tested your program, and you're right! The solvation of 
your problem is both tricky and simple. Compile with:
            gcc sin.c -lm
(Notice the position of -lm !). Now it'll work.
ciao
Michi
'Bye, bye Mister Pride' (ABC, Night you murdered Love)
----------------------------------------------------------------------
Dipl.-Ing                                       
Michael Schuster
Lehrstuhl fuer Elektrische Energieversorgung
Friedrich Alexander Universitaet Erlangen
Cauerstrasse 4
(0)9131 85 8761
----------------------------------------------------------------------
- Raw text -