From owner-freebsd-questions Wed Nov 27 10:34: 5 2002 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 E457C37B401 for ; Wed, 27 Nov 2002 10:34:03 -0800 (PST) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 327A843EB2 for ; Wed, 27 Nov 2002 10:34:01 -0800 (PST) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-b155.otenet.gr [212.205.244.163]) by mailsrv.otenet.gr (8.12.6/8.12.6) with ESMTP id gARIXmpw012895; Wed, 27 Nov 2002 20:33:53 +0200 (EET) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.6/8.12.6) with ESMTP id gARFW27W001196; Wed, 27 Nov 2002 17:32:02 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by gothmog.gr (8.12.6/8.12.6/Submit) id gARFW2mq001195; Wed, 27 Nov 2002 17:32:02 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 27 Nov 2002 17:32:02 +0200 From: Giorgos Keramidas To: Mike McGranahan Cc: freebsd-questions@FreeBSD.ORG Subject: Re: undefined references Message-ID: <20021127153202.GC609@gothmog.gr> References: <004601c29627$ab245090$1a00a8c0@HOME> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <004601c29627$ab245090$1a00a8c0@HOME> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-11-27 07:14, Mike McGranahan wrote: > i am trying to compile c++ code originally compiled on msvc++ on > freebsd-4.6.2-release. i'm relatively new to freebsd, and this is > my first attempt at coding on this platform. there are three source > files, all of which compile. however, when i try to link them > together, i get undefined references and other errors, such as > > retrquote.o: In function `main': > retrquote.o(.text+0x27): undefined reference to `endl(ostream &)' > retrquote.o(.text+0x34): undefined reference to `cerr' > retrquote.o(.text+0x39): undefined reference to `ostream::operator<<(char const *)' > retrquote.o(.text+0x44): undefined reference to `ostream::operator<<(ostream &(*)(ostream &))' Are you using `cc' as the compiler or `c++'? You should really use the second. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message