Try b=pow(a,1/2); or b=pow(a,0.5); 
IIRC, there is no sqrt function, however there is a pow function for a^b =
pow(a,b);

Devdas Bhagat.

On Fri, 14 Jan 2000, Philip S Tellis wrote:
>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

Reply via email to