I am having issues with usage of log10f(). I am compiling the program on Linux (2.6.28-11-generic) and using gcc (3.4.6).
The following source compiles and prints 1.000000 on execution.
#include <stdio.h>
#include <math.h>
int main() {
printf("%f\n", log10f(10));
return 0;
}
while the below one doesn't and throws up link error:
#include <stdio.h>
#include <math.h>
int main() {
printf("%f\n", log10f(100));
return 0;
}
Error : Undefined reference to log10f
Is the log10f() not defined as part of standard math library (Man pages indicate that it is part of math library)?
Why is that the second example doesn't compile?