Problem using math library

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

 



Hi,
I have problem using function in math.h.  gcc gives undefined reference
Here is a sample of my tstpow.c program:

#include <math.h>

int main()
{
   double d;

   d = pow(2.0, 3.0);
  return 0;
}

I compiled the program with:
    gcc tstpow.c

gcc gave this error:
   undefined reference pow

I tried other functions s.a. sqrt(), sin(), etc.  Same problem.
Other header files (s.a. <stdio.h> <string.h> <stdlib.h> work fine.

Please help.

Tom Tran
tom.tran@xxxxxxxx


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux