This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: math.h


"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"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]