[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C compiler.



On Tue, Jan 02, 2001 at 11:05:50PM +0000, paul wrote:
> hello all,
> i'm trying to compile (gcc filename.c) the following program, but it seems
> math.h isn't being found.
> 
> this is the error:
> /tmp/ccCw1SMR.o: In function `main':
> /tmp/ccCw1SMR.o(.text+0x52): undefined reference to `pow'
> collect2: ld returned 1 exit status

You need to link with the Math library (libm) aswell.

gcc filename.c -o prog -lm

-- 
 -----------=======-=-======-=========-----------=====------------=-=------
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'



Reply to: