This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with math.h
- To: tobias_meier at my-deja dot com
- Subject: Re: Problems with math.h
- From: Alexandre Oliva <oliva at lsd dot ic dot unicamp dot br>
- Date: 07 Jan 2000 06:51:26 -0200
- Cc: help-gcc at gnu dot org
- References: <85483i$a32$1@nnrp1.deja.com>
On Jan 7, 2000, tobias_meier@my-deja.com wrote:
> gcc MatheTest.c
> /tmp/ccdP8Uys.o: In function `main':
> /tmp/ccdP8Uys.o(.text+0xe): undefined reference to `exp'
> /tmp/ccdP8Uys.o(.text+0x37): undefined reference to `pow'
> collect2: ld returned 1 exit status
math.h is a *header*-file, it just supplies* declarations* of the math
functions. The *definitions* have already been compiled, and live in
the math *library*. You can link your program with the math library
by adding `-lm' to the compile+link command.
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them