howto sqrt?

Joachim Bauernberger nuklear@singnet.com.sg
Tue Dec 7 07:34:00 GMT 1999


haha@here.org wrote:

> Joachim Bauernberger <nuklear@singnet.com.sg> 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!

no you're right i havn't read the faq.
thank's for pointing things out.
joachim!



More information about the Gcc-help mailing list