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: Problems with math.h


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


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