From owner-freebsd-questions Fri Jul 21 01:31:59 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id BAA15732 for questions-outgoing; Fri, 21 Jul 1995 01:31:59 -0700 Received: from campino.informatik.rwth-aachen.de (campino.Informatik.RWTH-Aachen.DE [137.226.225.2]) by freefall.cdrom.com (8.6.11/8.6.6) with SMTP id BAA15723 for ; Fri, 21 Jul 1995 01:31:53 -0700 Received: from gilberto.physik.rwth-aachen.de by campino.informatik.rwth-aachen.de (4.1/campino-8) id AA21314; Fri, 21 Jul 95 10:31:35 +0200 Received: (from kuku@localhost) by gilberto.physik.rwth-aachen.de (8.6.8/8.6.9) id KAA26537; Fri, 21 Jul 1995 10:44:21 +0200 Message-Id: <199507210844.KAA26537@gilberto.physik.rwth-aachen.de> Subject: Re: Gnu C++ Compilation Problem To: amnuay@comnet.spu.ac.th (amnuay muthitacharoen) Date: Fri, 21 Jul 1995 10:44:20 +0200 (MET DST) Cc: freebsd-questions@freefall.cdrom.com (user alias) In-Reply-To: from "amnuay muthitacharoen" at Jul 21, 95 11:42:44 am From: Christoph Kukulies Reply-To: Christoph Kukulies X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 994 Sender: questions-owner@FreeBSD.org Precedence: bulk > > > When I compiled the following Gnu C++ program in FreeBSD Unix > installed from the FreeBSD CDROM :- How did you compile? I'm sure you forgot to specify -lm in the link command line. g++ -o file file.cc -lm > > #include > #include "/usr/include/math.h" > void > main() > { > int num ; > > cout << "Enter num : " ; > cin >> num ; > cout <<"The cube of " << num << " is " << pow(num,3) <<" .\n" ; > } > > > I got the following messages :- > > 1) /var/tmp/cc0100421.0: Undefined symbol '_pow' referenced from text segment > > 2) /usr/lib/libg++.so.2.0: Undefined symbol "_pow" referenced > > > Please tell me what I had done wrong or did I missed out something ? > > > Regards > > Amnuay Muthitacharoen > > --Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de FreeBSD blues.physik.rwth-aachen.de 2.2-CURRENT FreeBSD 2.2-CURRENT #0: Tue Jul 18 14:49:19 MET DST 1995 kuku@blues.physik.rwth-aachen.de: /usr/src/sys/compile/BLUESGUS i386