Re: gcc and math.h

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

 



On Sun, 2004-03-21 at 18:36, stucklenp wrote:
> Kind persons:
> 
> I routinely program using C and compile with gcc.  My problem is that I need
> some math log functions--ln, log10, and log2--and these functions are not
> included in math.h from what I can determine.  Can anyone suggest how I can
> get these functions?
> 
> I have tried notes to the glibc groups and not received any replies.
> 
> Thanks.
> 
> Paul


You need to add '-lm' as an argument to the gcc command line in order to
link in the math library.

For example:

gcc -O -o myprog myprog.c -lm

If you are unsure of the required header file, you can usually type
something like:

man log

at the command line.

HTH,

Marc Schwartz




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux