From owner-freebsd-questions Fri Jul 5 14:27:09 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA12770 for questions-outgoing; Fri, 5 Jul 1996 14:27:09 -0700 (PDT) Received: from mailhub.aros.net (mailhub.aros.net [205.164.111.17]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id OAA12763 for ; Fri, 5 Jul 1996 14:27:06 -0700 (PDT) Received: from terra.aros.net (terra.aros.net [205.164.111.10]) by mailhub.aros.net (8.7.5/Unknown) with ESMTP id PAA29247; Fri, 5 Jul 1996 15:28:36 -0600 (MDT) Received: (from angio@localhost) by terra.aros.net (8.7.5/8.6.12) id PAA23497; Fri, 5 Jul 1996 15:26:59 -0600 From: Dave Andersen Message-Id: <199607052126.PAA23497@terra.aros.net> Subject: Re: C libraries To: searle@longacre.demon.co.uk (Michael Searle) Date: Fri, 5 Jul 1996 15:26:59 -0600 (MDT) Cc: questions@freefall.freebsd.org In-Reply-To: from "Michael Searle" at Jul 5, 96 08:24:18 pm X-Mailer: ELM [version 2.4 PL25 PGP2] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk gcc -lm *** -- link the math library in. Lo and behold, Michael Searle once said: > > I have been having some problems getting C programs containing calls in > math.h to link - is there a special library I have to use? I wrote a test > program using sqrt(), but I get the same stuff for pow(), trig functions, > etc. I am using standard gcc 2.6.3 on FreeBSD 2.1R. Here is the test > program, the output I got from the linker, and my /usr/lib directory. > > It compiles and links OK, just using 'gcc sqrt.c -o sqrt', on a different > (not FreeBSD) system running gcc 2.4.5. > > Also, one of the programs also needed Motif (the Xm library) to compile. Is > there a free static version of the Motif library? (If so, where can I > download it from?) > > sqrt.c: > > #include > #include > > int main() { > double x; > > fprintf(stdout,"What is your number?"); > fscanf(stdin,"%lf",&x); > > fprintf(stdout,"The square root of %lf is %lf.",x,sqrt(x)); > > exit(); > } -- angio@aros.net Complete virtual hosting and business-oriented system administration Internet services. (WWW, FTP, email) http://www.aros.net/ http://www.aros.net/about/virtual "There are only two industries that refer to their customers as 'users'."