Mail Archives: djgpp/2002/03/08/02:08:34
On Thu, 7 Mar 2002, Chris Barry wrote:
> Hi. I need a little help with something; I've been using RHIDE and DJGPP for
> over a year, but sometimes (like right now), when I start a new project and
> try to compile a simple source file, RHIDE complains about cout being
> undeclared or somesuch. Here; I'm trying to compile a simple Hello, WOrld
> and I get errors:
>
> #include <iostream>
>
> int main()
> {
> cout << "Hello, World!!";
> return 0;
> }
>
> In functions `int main()':
> Hello.cpp(5) Error: `cout' undeclared (first use this function)'
>
> I'm not sure how to get rid of this. It usually doesn't happen. Any ideas?
> Thanks.
>
Perhaps You're using gcc-3.0.4 (or some earlier 3.0.X version) ...
cout is now in std namespace. Use std::cout instead or put
'using namespace std;' somewhere before that
Andris
- Raw text -