From owner-freebsd-questions Sat Jul 22 02:19:32 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id CAA16046 for questions-outgoing; Sat, 22 Jul 1995 02:19:32 -0700 Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id CAA16039 for ; Sat, 22 Jul 1995 02:19:29 -0700 Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.9/8.6.9) id TAA26022; Sat, 22 Jul 1995 19:05:11 +0930 From: Michael Smith Message-Id: <199507220935.TAA26022@genesis.atrad.adelaide.edu.au> Subject: Re: Gnu C++ Compilation Problem To: chuckr@Glue.umd.edu (Chuck Robey) Date: Sat, 22 Jul 1995 19:05:10 +0930 (CST) Cc: amnuay@comnet.spu.ac.th, questions@freebsd.org In-Reply-To: from "Chuck Robey" at Jul 21, 95 07:52:00 pm Content-Type: text Content-Length: 1371 Sender: questions-owner@freebsd.org Precedence: bulk Chuck Robey stands accused of saying: > > cout <<"The cube of " << num << " is " << pow(num,3) <<" .\n" ; > > 1) /var/tmp/cc0100421.0: Undefined symbol '_pow' referenced from text segment > > 2) /usr/lib/libg++.so.2.0: Undefined symbol "_pow" referenced > > You called pow with at least one int, the 3 might be an int too. Pow is > supposed to be double pow( double, double), so you confused the system. > Change your types, I bet it will work if you give it the right ones. > Remember that under C++, the types are combined with the function name to > define which function you *really* call. This is misleading; if the prototype for pow() is in scope (as it is, as math.h was included), the arguments will be cast to match the prototype. If they couldn't be safely cast, an error would have been generated on that topic. Either way, the offending symbol is _pow, which has no argument type encoding 8) > Chuck Robey | Interests include any kind of voice or data -- ]] Mike Smith, Software Engineer msmith@atrad.adelaide.edu.au [[ ]] Genesis Software genesis@atrad.adelaide.edu.au [[ ]] High-speed data acquisition and [[ ]] realtime instrument control (ph/fax) +61-8-267-3039 [[ ]] My car has "demand start" - Terry Lambert [[