🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.help
Article #629

a very simple question

#629
From: Troy Frever
Date: Thu, 17 Dec 1992 19:28
24 lines
1078 bytes
I apologize in advance for what is undoubtedly a very simple question
from a novice (myself).  I have a short program which compiles and
executes using CC (on my Sun Sparc2) but which I am unable to compile
using g++.  The program is:

#include <iostream.h>
main()
{
int index = 10;

   cout << "The hex value of index is " << hex << index << "\n";
}

The error message is:

g++ -g   -o test test.cc 
test.cc: In function `int  main ()':
test.cc:7: undefined ostream operator << ()

Why is it gagging on the "hex" manipulator (it works if I remove it),
and how do I correct it?  Please reply directly to me.  Thanks.

Troy Frever
troy@u.washington.edu
Technical Details
Message-ID: <troy.724620496@buck>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!troy

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.help
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!troy
From: troy@cqs.washington.edu (Troy Frever)
Subject: a very simple question
Message-ID: <troy.724620496@buck>
Sender: news@u.washington.edu (USENET News System)
Organization: University of Washington
Date: Thu, 17 Dec 1992 19:28:16 GMT
Lines: 24