From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandre Oliva To: tobias_meier@my-deja.com Cc: help-gcc@gnu.org Subject: Re: Problems with math.h Date: Fri, 07 Jan 2000 00:51:00 -0000 Message-id: References: <85483i$a32$1@nnrp1.deja.com> X-SW-Source: 2000-01/msg00084.html 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandre Oliva To: tobias_meier@my-deja.com Cc: help-gcc@gnu.org Subject: Re: Problems with math.h Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-ID: References: <85483i$a32$1@nnrp1.deja.com> X-SW-Source: 2000-q1/msg00084.html Message-ID: <20000401000000.yFuzwNGjWqZnwnKq5QqAmHiSOVARP3Ug2X23jR7wkek@z> 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