pow() function question

Peter L. Peres plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Wed Oct 20 20:08:02 UTC 2004



On Wed, 20 Oct 2004 talexb-SBdzbUvMQDunS0EtXVNi6w at public.gmane.org wrote:

> On Wed, 20 Oct 2004 fcsoft-3Emkkp+1Olsmp8TqCH86vg at public.gmane.org wrote:
>
>> What library does one have to link in to enable the pow() function in a C
>> program?
>
> [alex at foobar alex]$ man pow
> EXP(3)                   Linux Programmer's Manual                  EXP(3)
>
> NAME
>       exp, log, log10, pow - exponential, logarithmic and power functions
>
> SYNOPSIS
>       #include <math.h>
> ...
>
> Now you know how to find out.

No, he does not. You need to specify -lm as a linker option to *link* libm 
which is the math library that contains pow() etc.

Peter
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list