From owner-freebsd-questions@FreeBSD.ORG Mon Nov 8 19:04:04 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4690616A4CE for ; Mon, 8 Nov 2004 19:04:04 +0000 (GMT) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 567D043D2D for ; Mon, 8 Nov 2004 19:04:02 +0000 (GMT) (envelope-from seebs@plethora.net) Received: from guild.plethora.net (guild.plethora.net [205.166.146.8]) by herd.plethora.net (8.13.1/8.12.11) with ESMTP id iA8J41Ff009205; Mon, 8 Nov 2004 13:04:01 -0600 (CST) Message-Id: <200411081904.iA8J41Ff009205@herd.plethora.net> From: seebs@plethora.net (Peter Seebach) To: Vince Sabio In-reply-to: Your message of "Mon, 08 Nov 2004 14:00:33 EST." Date: Mon, 08 Nov 2004 13:03:54 -0600 cc: freebsd-questions@freebsd.org Subject: Re: math.h doesn't include pow? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Peter Seebach List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2004 19:04:04 -0000 In message , Vince Sabio writes: >My C library documentation states that the "pow" (power) function is >included in math.h. However, when I go to link (compiling and linking >with gcc), I get the following: > >In function `[function name]': >[path/]datetime.c:668: undefined reference to `pow' > >Yes, I'm including . If I compile the exact same code under >Darwin (BSD on PowerPC), it compiles fine. It also compiles in >CodeWarrior. Is anyone else familiar with this problem? Could I have >a path set up incorrectly, and be using the wrong libraries? > >Running FreeBSD v5.1, installed from CD, including the developer >tools. Single-boot system; there is no Microsoft software anywhere on >the machine, so it's not their fault (for a change). ;-) FAQ. Very FAQ. Headers and libraries are distinct. Headers provide prototypes; libraries provide definitions. You want "-lm". -s