The linking of math.lib using -lm is working is a different manner in gcc 4.6.3.
It use to work gcc -lm file.c but in gcc 4.6.3 its gcc file.c -lm.
What is the reason for this change? Or is it a bug?
Thanks
This is a part of the code.
float i = 100;
printf("%f", sqrt(i));
return 0;
I complied like this
gcc -lm mat.c
/tmp/ccPxTEjS.o: In function `main':
mat.c:(.text+0x2c): undefined reference to `sqrt'
collect2: ld returned 1 exit status
Operating System : Ubuntu 12.04
gcc -lm file.con 4.6.3? You didn't specify what the problem is. - Jonathon Reinhart