Trouble finding C's math functions: log10(), sin, etc...

Trouble finding C's math functions: log10(), sin, etc...

Post by Gregory Mai » Fri, 25 Nov 1994 03:44:10



Do you know where I can get the C runtime library math functions?
I'm writing a C program and I want to call log10().  When I compile,
the error I get is "... undefined symbol _log10()..."

Using: SLS 1.0
Kernel: 1.55
GCC: Version 2.5.8
LibC: Versions 4.5.pl25 (I think)

Any help appreciated.

Greg

 
 
 

Trouble finding C's math functions: log10(), sin, etc...

Post by Don Benne » Fri, 25 Nov 1994 21:49:40



>Do you know where I can get the C runtime library math functions?
>I'm writing a C program and I want to call log10().  When I compile,
>the error I get is "... undefined symbol _log10()..."

The math functions are in the "libm.a" library.  To use it, add "-lm" to
the end of "gcc <junk> -lm" as shown.  (<junk> is whatever you type
now.)  Make sure you #include(d) <math.h> as well.  After that you
shouldn't have a problem.

Hope This Helps,
Don

--
"The human race is a remarkable creature, one with great potential, and I
hope that Star Trek has helped to show us what we can be if we believe
in ourself and our abilities."             -Gene Roddenberry (1921-1991)


 
 
 

Trouble finding C's math functions: log10(), sin, etc...

Post by Eric Wampner O » Sat, 26 Nov 1994 17:34:12


: Do you know where I can get the C runtime library math functions?
: I'm writing a C program and I want to call log10().  When I compile,
: the error I get is "... undefined symbol _log10()..."

: Using: SLS 1.0
: Kernel: 1.55
: GCC: Version 2.5.8
: LibC: Versions 4.5.pl25 (I think)

: Any help appreciated.

Er, did you link with the math library?

gcc x -lm

eric
--
---

Computer Systems Administrator
Orlando Group                    Coleman Research Corp