From: "Michael Schuster" Organization: LS f. Elektrische Energieversorgung To: andrea DOT tasso AT galactica DOT it (andrea tasso), djgpp AT delorie DOT com Date: Thu, 11 Jan 1996 08:22:31 MET Subject: Re: help ! undefined reference when compiling Gruess Dich! > When compiling the following program with djgpp for dos > > #include > 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 ----------------------------------------------------------------------