You need to tell the compiler your using the math library. Do this
by using:

        gcc filename.c -lm

That should work.

On Mon, 8 Jun 1998, Bernd Antweiler wrote:

> Hello all together!
> 
> I am programming in C under Linux with Gnu-C-Compiler and xwpe frontend (X-
> desktop). My program is nearly finished, everything has worked fine until yet. Now I 
> have tried to use some mathematical functions like pow(x,y), sin(x), etc.. 
> #include <math.h> at the top of the C-file let me compile the file, but on starting 
>or 
> debugging the project an "undefined reference"-error appears. Only the fabs(x) -
> order of this library seems to work! 
> I find the <math.h> file in the /usr/include directory and this directory is 
>declared 
> under compiler options and the project options, too. 
> Is there any idea to solve the problem? I use the Suse-distribution and my Linux 
> knowledge is not so good, because it was not needed by this comfortably 
> distribution.
> Maybe a file is lost? Which file? 
> 
> Thanks for your attention.
> 
> Bernd Antweiler
> [EMAIL PROTECTED] 
>   
> 

Best wishes 

   - Karl F. Larsen, 3310 East Street, Las Cruces,NM (505) 524-3303  -

Reply via email to