Article View: gnu.gcc.help
Article #50797ANSWER (woops! how stupid!) Re: gcc can't seem to find pow() but I did #include math.h
From: Edward Hartnett
Date: Thu, 26 Aug 1993 13:46
Date: Thu, 26 Aug 1993 13:46
28 lines
1802 bytes
1802 bytes
In article <EJH.93Aug26134131@twod.gsfc.nasa.gov> ejh@twod.gsfc.nasa.gov (Edward Hartnett) writes:
I just got the following error message when trying to compile:
cd /home/ejh/nmc_link/
gcc -o split84 split84.c
/usr/bin/ld:
Undefined:
pow
collect: ld returned 1 exit status
But I did include math.h, and looking in /usr/include/math.h I see a
pow and a powf function. (I tried both). What am I doing wrong here?
--
Of course, as soon as I posted I realized that I hadn't included -lm
in the compile command. I canceled the article, but in case it did get
out first, I just wanted to appologize for asking such a dumb
question. On the other hand, maybe it will make some people happy to
have such an easy question that will make them feel smart because they
know the answer! ;-)
--
Edward Hartnett ejh@twod.gsfc.nasa.gov
(301) 286-2396
Technical Details
Message-ID:
<EJH.93Aug26134638@twod.gsfc.nasa.gov>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!spool.mu.edu!agate!ames!skates.gsfc.nasa.gov!gsfc.nasa.gov!ejhReferences:
<EJH.93Aug26134131@twod.gsfc.nasa.gov>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,3e800710283b6e64,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-08-26 10:52:50 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!spool.mu.edu!agate!ames!skates.gsfc.nasa.gov!gsfc.nasa.gov!ejh From: ejh@twod.gsfc.nasa.gov (Edward Hartnett) Newsgroups: gnu.gcc.help Subject: ANSWER (woops! how stupid!) Re: gcc can't seem to find pow() but I did #include math.h Date: 26 Aug 93 13:46:38 Organization: Goddard Space Flight Center Lines: 28 Message-ID: <EJH.93Aug26134638@twod.gsfc.nasa.gov> References: <EJH.93Aug26134131@twod.gsfc.nasa.gov> NNTP-Posting-Host: twod.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit In-reply-to: ejh@twod.gsfc.nasa.gov's message of 26 Aug 93 13:41:31