Looking for pow function in C

Janos Murvai murvai@ncbi.nlm.nih.gov
Wed Dec 3 18:55:00 GMT 2003


Please use -lm

gcc c_prog.c -lm -o c_prog

Janos

On Wed, 3 Dec 2003 tonibin@libero.it wrote:

> Dear gcc team:
>
> I'm a C programmer, and I use gcc. Recently I upgraded my Linux box to
> RedHat 9A.
>
> Starting a C project, everything went ok until I did a math operation.
>
> I included <math.h>, and executed a simple pow(x1,x2) function, with x1
> and x2 of type double.
>
> The compiler reports:
>
> /tmp/cctlMXxf.o(.text+0x948): In function `parseString':
> : undefined reference to `pow'
> collect2: ld returned 1 exit status
>
> The #include <math.h> is regular.
>
> What's the problem? I'm sure that the gcc package is installed correctly,
> but grepping the /usr/include directory, no file with the pow definition
> seem to exist. And even log, log10 and exp seem to have vanished.
>
> Any help?
>
> Thank you.
>
> Version used:
> gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
>
>
> --
> Antonio Maschio
> <tbin@libero.it>
>
>



More information about the Gcc-help mailing list