On 08/11/2010 06:31 PM, Dj YB wrote:
> I have written a small program in C and I am using the math.h library using
> so far everything is good.
> when using the function sqrt I get the next error:
> $ cc a.c
> /tmp/ccTaon4H.o: In function `main':
.text+0x3e): undefined reference to `sqrt'
> to be sure I checked man sqrt:
> double sqrt(double x);
A couple of lines later you will find this sentence:
" Link with -lm."
> I have no idea what is wrong, any suggestions are welcome.
Math functions are not contained in libc, they are in a separate library
=> cc a.c -lm
users mailing list
To unsubscribe or change subscription options: