howto sqrt?
haha@here.org
haha@here.org
Tue Dec 7 01:50:00 GMT 1999
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!
More information about the Gcc-help
mailing list