----- Original Message -----
From: Sameer D. Sahasrabuddhe <[EMAIL PROTECTED]>
To: ILUG-Bom <[EMAIL PROTECTED]>
Sent: Saturday, July 10, 1999 9:26 PM
Subject: gcc


> Hey guys
>
> Has anyone tried using gcc or cc on Redhat6.0? Whatever I do, it simply
> doesnt seem to work.
>
> The program I tried was pretty simple - it just has a line that prints the
> value of cos(3.14159) I have included <math.h> at the start and its too
> easy not to work. But the compiler gives a message saying "in function
> main() - undefined reference to function cos" I am really stumped since
> this had worked perfectly on my Redhat5.0 quite a long time back.
>

Have you linked the math library during compilation? I guess you haven't
included -lm during compile and linking.
Try something like this
gcc -lm test.c

Kousik



Reply via email to