Mailing List Archive

Support open source code!


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

problems with pow( ) in gcc



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


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links