help with 'hello world'

David Syphers dsyphers at u.washington.edu
Wed Aug 25 19:51:24 PDT 2004


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 <iostream>

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

-- 
+++ Divide By Cucumber Error. Please
Reinstall Universe And Reboot. +++


More information about the freebsd-questions mailing list