Error: Undefined reference to ''

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

 



Hello.

I am trying to compile the following code

 1 #include <stdio.h>
 2 #include <math.h>
 3 int main (){
 4         double a = 0.0;
 5         double b = pow (10,a);
 6         return 1;
 7 }

while I was given the following error message

caojun@ubuntu:~/homework$ gcc -o test.out utility.c
/tmp/ccOQV3cx.o: In function `main':
utility.c:(.text+0x27): undefined reference to `pow'
collect2: ld returned 1 exit status

My gcc pakages
               gcc-4.1
               gcc-4.1-multilib
               gcc-4.2

Can anyone help me please?

Sincerely
Cao Jun

[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