Mailing List Archive

Support open source code!


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

Re: problems with pow( ) in gcc



On Wed, 31 Jan 2001 12:30:54 +0900
Hector Akamine <akamine@example.com> was chatting the other day about l and said:


The problem is "pow" is not declared on math.h (at least it doesnt appeara on my header files either, and its redhat's glibc.
dont know if redhat screw something, or if glibc is laggin it.

pow does appear in the info pages, but it doesnt say what header it requires.

> I was trying to compile this simple program. The gcc compiler is the one
> included in Vine Linux 2.0
> 
> ------- program begin ----------
> 
> #include <stdio.h>
> #include <math.h>
> 
> int main() {
>   double maxi;
> 
>   printf("pow test:");
>   maxi = pow (2.0, 5.0 );
>   printf("%f\n",maxi);
> 
> }
> 
> ------- program end ----------
> 
> But the compiler throws the following error:
> 
> ------- begin --------
> $ gcc -o test test.c
> 
> 
> /tmp/ccfCPb5f.o: In function `main':
> /tmp/ccfCPb5f.o(.text+0x22): undefined reference to `pow'
> collect2: ld returned 1 exit status
> 
> -------- end ---------
> 
> What am I doing wrong?
> 
> 
> Thanks in advance
> 
> -----------------------------------------------------------------------
> Next Nomikai Meeting:    Fri, February 16 19:30- Tengu Tokyo Eki Mae
> Next Technical Meeting:  March (date TBA)
> -----------------------------------------------------------------------
> more info: http://www.tlug.gr.jp           Sponsor: Global Online Japan
> 


-- 
ICQ: 15605359 Bicho
                                  =^..^=
First, they ignore you. Then they laugh at you. Then they fight you. Then you win. Mahatma Gandhi.
........Por que no pensaran los hombres como los animales? Pink Panther........
-------------------------------気検体の一致------------------------------------
暑さ寒さも彼岸まで。
アン アン アン とっても大好き

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links