Am Mittwoch, 29. Oktober 2003 21:24 schrieb oguz eren:
I'm so new with c language, therefore this may be
a fool one.
Here's my code:
x = 64.0;
printf("kok : %f.\n", sqrt(x));
In function `main':
: undefined reference to `sqrt'
collect2: ld returned 1 exit status
Seems it can't find it in math.h; true? A grep showed me it's in
tgmath.h instead.But including tgmath.h also didn't change anything.
No, you have to link it with libm.
$ gcc -lm -o program program.c