From mboxrd@z Thu Jan 1 00:00:00 1970 From: haha@here.org To: help-gcc@gnu.org Subject: Re: howto sqrt? Date: Tue, 07 Dec 1999 01:50:00 -0000 Message-id: <82ikm6$okv$1@oravannahka.helsinki.fi> References: <384CD454.A7C437C@singnet.com.sg> X-SW-Source: 1999-12/msg00101.html Joachim Bauernberger wrote: :>i'm pretty new using the gcc. most of my programming sofar has been :>under windoze 8-( using the borland tools. :>unfortunatly i am not able to use the sqrt or pow function. can anybody :>tell me what i'm doing wrong here? Yes. You haven't read the FAQ which answers your question which has been asked and answered frequently. :>if i compile the following c program using the compiler options: gcc -g :>-D_GNU_SOURCE -Wall filename.c -o outputfile :>i get these errors: undefined reference to 'sqrt' You just need one more option: -lm, which links in the math-library. This library defines sqrt(), pow() and many other mathematical functions. Haha! From mboxrd@z Thu Jan 1 00:00:00 1970 From: haha@here.org To: help-gcc@gnu.org Subject: Re: howto sqrt? Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: <82ikm6$okv$1@oravannahka.helsinki.fi> References: <384CD454.A7C437C@singnet.com.sg> X-SW-Source: 1999-12n/msg00101.html Message-ID: <19991231222400.oDaFuhvPA0_TpXV29bJC0wGvYlZ7rIDqgCQp0IdQfVc@z> Joachim Bauernberger wrote: :>i'm pretty new using the gcc. most of my programming sofar has been :>under windoze 8-( using the borland tools. :>unfortunatly i am not able to use the sqrt or pow function. can anybody :>tell me what i'm doing wrong here? Yes. You haven't read the FAQ which answers your question which has been asked and answered frequently. :>if i compile the following c program using the compiler options: gcc -g :>-D_GNU_SOURCE -Wall filename.c -o outputfile :>i get these errors: undefined reference to 'sqrt' You just need one more option: -lm, which links in the math-library. This library defines sqrt(), pow() and many other mathematical functions. Haha!