Problem compiling with gcc.

Sam Varshavchik mrsam at courier-mta.com
Sat Aug 27 16:10:21 UTC 2005


Robert Cahn writes:

> All was well until I needed to use the pow function.  I used 
> #include <math.h>
> as in the past but when I link I get
> 
> calculate.o(.text+0x14bf): In function `cgiMain':
> calculate.c: undefined reference to `pow'
>  
> when I look at math.h there is no reference to pow.

math.h includes bits/mathcall.h, which defines pow().

Add the -lm flag to your link command.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20050827/3b3269ee/attachment-0001.sig>


More information about the fedora-list mailing list