From owner-freebsd-questions@FreeBSD.ORG Thu Aug 26 02:59:08 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 5693316A4CF for ; Thu, 26 Aug 2004 02:59:08 +0000 (GMT) Received: from sccmmhc92.asp.att.net (sccmmhc92.asp.att.net [204.127.203.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id C51FA43D2D for ; Thu, 26 Aug 2004 02:59:07 +0000 (GMT) (envelope-from josh@tcbug.org) Received: from [10.0.0.10] (12-218-40-24.client.mchsi.com[12.218.40.24]) by sccmmhc92.asp.att.net (sccmmhc92) with ESMTP id <20040826025907m920081v3pe>; Thu, 26 Aug 2004 02:59:07 +0000 From: Josh Paetzel To: David Syphers Date: Wed, 25 Aug 2004 21:58:39 -0500 User-Agent: KMail/1.6.1 References: <200408251940.07032.dsyphers@u.washington.edu> <20040826024626.GA25115@xor.obsecurity.org> <200408251951.41684.dsyphers@u.washington.edu> In-Reply-To: <200408251951.41684.dsyphers@u.washington.edu> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408252158.39025.josh@tcbug.org> cc: questions@freebsd.org Subject: Re: help with 'hello world' X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2004 02:59:08 -0000 On Wednesday 25 August 2004 21:51, you wrote: > On Wednesday 25 August 2004 07:46 pm, Kris Kennaway wrote: > > On Wed, Aug 25, 2004 at 07:40:07PM -0700, David Syphers wrote: > > > This compiles fine on SunOS using egcs-2.91.66. However, it > > > fails on FreeBSD (gcc 3.4.2) and RedHat (gcc 3.2.3) with the > > > bizarre error "`cout' undeclared". > > > > How are you compiling it? At a guess, it sounds like you're > > using the C compiler (gcc) not the C++ compiler (g++). > > No, I'm using g++: > > yggdrasil> cat test.cpp > #include > > int main() > { cout << "Hello World"; > return 0; } > > yggdrasil> g++ test.cpp > test.cpp: In function `int main()': > test.cpp:4: error: `cout' undeclared (first use this function) > test.cpp:4: error: (Each undeclared identifier is reported only > once for each function it appears in.) > > -David #include using std::cout; using std::endl; int main() { cout << "Hello World!" << endl; return 0; } -- Thanks, Josh Paetzel