This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: math.h
- To: help-gcc at gnu dot org
- Subject: Re: math.h
- From: Arthur Gold <agold at bga dot com>
- Date: Wed, 20 Oct 1999 00:27:11 -0500
- Newsgroups: gnu.gcc.help
- References: <380D58F1.B400EF83@primenet.com>
- Xref: wodc7nx0 gnu.gcc.help:1469
"Dennis J. Sylvester" wrote:
>
> I tried using the sqrt() function with gcc and get an error : undefined
> reference to 'sqrt'. If I compile with g++ I have no problem. I get
> the same result when trying to use pow() also. What am I missing?
>
> Any help would be appreciated.
>
> Dennis
Add the option -lm to your command line when you compile.
</rant on>
...and read the FAQs...and the docs...it's all in there...in fact if you
LOOK, this has probably been covered at least twice this week on this
and similar newsgroups...
</rant off>
HTH,
--ag
--
Artie Gold, Austin, TX
mailto:agold@bga.com or mailto:agold@cs.utexas.edu
--
Pet peeve: "its" = belonging or pertaining to "it" | "it's" = "it is"
- References:
- math.h
- From: Dennis J. Sylvester