try with 'gcc -lm <programname>'
Regards,
Jay Shah
WebSite : - http://members.xoom.com/linux_always
E-mail :- [EMAIL PROTECTED]
Fax :- (801)457-0562
ICQ : - 28959413
----- Original Message -----
From: Philip S Tellis <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 14, 2000 4:51 AM
Subject: [ILUG-BOM] Help with compiling C program
> I cannot compile (link actually) any program that has functions from
> math.h
>
> even something simple like this:
>
> #include <math.h>
>
> int main() {
> double a=4.3, b;
> b = sqrt(a);
> return 0;
> }
>
> will not link. I just get an error that says:
>
> a.o(.text+0x1e): undefined reference to `sqrt'
>
>
> It seems that the linker cannot find the definition of the sqrt function.
> Actually, neither can I.
>
> Will someone please tell me which library needs to be linked in to get a
> sqrt function working.
>
> I have egcs.
>
> Philip
>
>
> To subscribe / unsubscribe goto the site www.ilug-bom.org ., click on the
mailing list button and fill the appropriate information
> and submit. For any other queries contact the ML maintener
>
To subscribe / unsubscribe goto the site www.ilug-bom.org ., click on the mailing list
button and fill the appropriate information
and submit. For any other queries contact the ML maintener