Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!bc From: bc@uxa.cso.uiuc.edu (Ben Cox) Newsgroups: comp.unix.programmer Subject: Re: C libraries Message-ID: <1991Jan3.115324.7357@ux1.cso.uiuc.edu> Date: 3 Jan 91 11:53:24 GMT References: <1990Dec19.232345.1397@dayton.saic.com> <1990Dec23.230945.10473@xrtll.uucp> <7774@umd5.umd.edu> Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 15 xialin@umd5.umd.edu (Xia Lin) writes: >I would like to use some math functions in in my C program (in unix). > The compiler keeps telling me that "undefined: _exp, _sqrt", even though I > have included a "#include " statement at the begining of my program. >What did I do wrong? Do I need to use some compiler options like "cc -?" for using library functions? >Thanks in advance for any helps. cc foo.c -lm ^^^ This is the important part -- link in the math library. -- -- Ben Cox bc@uxa.cso.uiuc.edu