Date: Sat, 22 Jul 1995 19:05:10 +0930 (CST) From: Michael Smith <msmith@atrad.adelaide.edu.au> To: chuckr@Glue.umd.edu (Chuck Robey) Cc: amnuay@comnet.spu.ac.th, questions@freebsd.org Subject: Re: Gnu C++ Compilation Problem Message-ID: <199507220935.TAA26022@genesis.atrad.adelaide.edu.au> In-Reply-To: <Pine.SUN.3.91.950721194945.15366B-100000@cappuccino.eng.umd.edu> from "Chuck Robey" at Jul 21, 95 07:52:00 pm
next in thread | previous in thread | raw e-mail | index | archive | help
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 [[
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507220935.TAA26022>