I write a C code that have power function that is from math.h library. when I compiled my program, I received an error which is " undefined reference to 'pow' function ", I compile my program using gcc compiler (fedora 9).
I insert -lm flag to gcc then, the error is omitted but the output of the pow function is 0.
#include<math.h>
main()
{
double a = 4, b = 2;
b = pow(b,a);
}
Can anyone help me? Is there is a problem in my compiler??
Thanks.