Cant understand this strange behavior with math.h.
<code>
#include<math.h>
int main()
{
double t = log10(10);
return 1;
}
</code>
works fine
but
<code>
#include <math.h>
int main()
{
double t1=10;
double t = log10(t1);
return 1;
}
</code>
gives the following error
log2.c.text+0x36): undefined reference to `log10'
collect2: ld returned 1 exit status
I am compiling this on linux platform using gcc.
<code>
#include<math.h>
int main()
{
double t = log10(10);
return 1;
}
</code>
works fine
but
<code>
#include <math.h>
int main()
{
double t1=10;
double t = log10(t1);
return 1;
}
</code>
gives the following error
log2.c.text+0x36): undefined reference to `log10'
collect2: ld returned 1 exit status
I am compiling this on linux platform using gcc.