From owner-freebsd-questions Sat Feb 6 16:57:32 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA15931 for freebsd-questions-outgoing; Sat, 6 Feb 1999 16:57:32 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from shemp.palomine.net (shemp.palomine.net [205.198.88.200]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id QAA15908 for ; Sat, 6 Feb 1999 16:57:10 -0800 (PST) (envelope-from cjohnson@palomine.net) Received: (qmail 23871 invoked by uid 1000); 7 Feb 1999 00:57:04 -0000 Date: Sat, 6 Feb 1999 19:57:04 -0500 From: Chris Johnson To: Keith Anderson Cc: questions@FreeBSD.ORG Subject: Re: math.h ? Message-ID: <19990206195704.A23866@palomine.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: ; from Keith Anderson on Sun, Feb 07, 1999 at 11:32:38AM +1100 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Feb 07, 1999 at 11:32:38AM +1100, Keith Anderson wrote: > HI All, > > Below I have a very simple 'c' program but I can't make it work !! What am I > doing wrong, it will not compile? > > Any help would be great > > Thanks > > Keith > > > #include > > main () > { > double x = 64; > double ans; > ans = sqrt(x); > > printf("ans = %lf\n",ans); > > } > > > > keith@wis~>cc test.c > /var/tmp/ccV145121.o: Undefined symbol `_sqrt' referenced from text segment You've got to link it with libm, like so: cc -lm test.c Chris To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message