Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Aug 2004 19:40:07 -0700
From:      David Syphers <dsyphers@u.washington.edu>
To:        freebsd-questions@freebsd.org
Subject:   help with 'hello world'
Message-ID:  <200408251940.07032.dsyphers@u.washington.edu>

next in thread | raw e-mail | index | archive | help
It's been a while since I wrote anything in C++, but this is sad - I can't get 
hello world to compile. Could some kind person please tell me what, exactly, 
is wrong with:

#include <iostream>

int main()
{
cout << "Hello World";
return 0;
}

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".

This happens with <vector> too. However, I can use iostream.h and vector.h, 
though it complains they're deprecated. 

Thanks for the help,

-David

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408251940.07032.dsyphers>