*BSD News Article 19088


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!network.ucsd.edu!news.cerf.net!nic.cerf.net!speakez
From: speakez@nic.cerf.net (Robert Crowe)
Newsgroups: comp.os.386bsd.bugs
Subject: Re: can't use function exp() in math.h
Date: 2 Aug 1993 05:41:12 GMT
Organization: CERFnet Dial n' CERF Customer
Lines: 19
Message-ID: <23i9dp$btk@news.cerf.net>
References: <23i8ro$l8d@usenet.INS.CWRU.Edu>
NNTP-Posting-Host: nic.cerf.net

In article <23i8ro$l8d@usenet.INS.CWRU.Edu> cc465@cleveland.Freenet.Edu (Steven M Ratliff) writes:
>
>	I've been trying to use the function exp() in math.h in a simple
>program under 386BSD + pk 2.4.  I've put in #include <math.h> at the top
>of the program but always get an error message when linking.
>The error is.  "Undefined symbol _exp referenced from text segment".
>I've explicitly tried linking in the math lib with cc -lm test.c and it still

Make sure the -lm comes after anything that references it (In this
case, after test.c).  Ld does one pass through libraries, and if it
doesn't need a symbol when it's scanning the library, it forgets about
it forever.

>cc465@cleveland.freenet.edu	  "When all was said and done, more was 
>   <Steve Ratliff> or		   said than done."  -???
>stever@wariat.org  ------------------------------------------------------

Bob Crowe			- bob@speakez.com