Mail Archives: djgpp/2002/07/23/08:00:04
"Daniel Noorduin" <w DOT noorduin AT chello DOT nl> wrote in
news:X9b%8.1034150$yP6 DOT 33807330 AT Flipper:
>
>> > C:/djgpp/lang/cxx-v31/backward/iostream.h(31) In file included from
>> > C:/djgpp/lang/cxx-v31/backward/iostream.h:31
>> > C:/djgpp/lang/cxx-v31/backward/backward_warning.h(32) Error: 2:
>> > warning
> This
>> > file includes at least one antiquated header.... etc. To disable
>> > this warning use -Wno-deprecated.
>>
>> For the second problem, use <iostream> instead of <iostream.h>.
>
> I already tried that. It recognizes the name iostream but goes on
> complaining about the iostream functions I use. Since I'm new to C++
> it might very well be something i overlooked or some other stupid
> mistake on my part. I copied the example program code straight from a
> tutorial written especially for RHIDE and DJGPP, so I assumed it would
> work if i could only manage to set up my compiler. Anyway here's what
> it says this time (with iostream instead of iostream.h):
>
> Error: cout undeclared (first use in this function)
> Error: endl undeclared (first use in this function)
> Error: (Each undeclared identifier is reported only once for each
> function it appears in)
cout and endl live in the std namespace. gcc 3.0.x enforces namespaces
and does not automatically put everything in std into the global
namespace. so, you either need a
using std;
after your includes, or need to refer to cout as std::cout. AFAIK, the
latter is preferred so as to reduce namespace pollution.
--
A. Sinan Unur
asu1 AT c-o-r-n-e-l-l DOT edu
Remove dashes for address
Spam bait: mailto:uce AT ftc DOT gov
- Raw text -