Re: strange behaviour of gcc 4.0.2



On Sunday 26 Feb 2006 11:35 in article
<184302tg2ip7bdhn1nhci5velu4u8lbqmi@xxxxxxx> of
comp.os.linux.development.apps, Michael.Ruehling@xxxxxxxxxxx wrote:

at least i was ready to attack some program which is to be done
since December. So i started typing some files and tried to compiler
them. And guess what, my compiler told me that he does not know
anything about cout/cin/cerr and all that stuff concerning
StreamIO. Is this correct and when yes, why? It seems part of
C++ standard lib.

You did incorporate namespace "std" in some way, didn't you?

Either:
#include <iostream>
using namespace std;
. . .
cout << "Hello, World!\n";
Or:
#include <iostream>
. . .
std::cout << "Hello, World!\n";

P.S.: coded so far on WinNT

Ah! Microsplat's compilers don't always follow ISO/ANSI standards, so
what counts as C++ on Winslug isn't necessarily C++ in the rest of the
world.

--
Regards

Dave [RLU#314465]
======================================================
dwnoon@xxxxxxxxxxxxxxxxxxxxx (David W Noon)
Remove spam trap to reply via e-mail.
======================================================

.



Relevant Pages

  • Re: Template problem with visual studio.net
    ... >using namespace std; ... When compiling FILE #2, on the other hand, the compiler doesn't see the ... and so it cannot instantiate the constructor ...
    (comp.lang.cpp)
  • Re: Trying to learn c++, need help compiling
    ... I was just trying to verify headers, ... I was used to using a compiler that _defaulted_ to namespace std, ... Right around 1997, if memory serves, when the ANSI standard was adopted. ...
    (alt.os.linux.suse)
  • Re: g++ where can I find it?
    ... although there might be a compiler switch to turn this off. ... using namespace std; ... with or without the '-Wno-deprecated' switch. ... I had heard mention of using the namespace std declaration. ...
    (alt.os.linux.suse)
  • Re: socket programming linux
    ... As Jens said already you need to include to have cout available. ... But maybe it's included in Socket oder "string.h" (btw: I would not recommend to use a name of a standard library header file for your header files). ... as the C++ Standards Committee once decided to put virtualy all stl features in namespace std. ... Since g++ version 3 the compiler obeys this and in order to access cout you must qualify it with std-namespace: ...
    (comp.os.linux.development.apps)
  • Re: Useful examples of computer programs
    ... using namespace std; ... the program omits to write a newline to cout, ... If the first and simplest program has three mistakes in it, how many more mistakes will there be in more 'advanced' programs? ... Borland C++ compiler. ...
    (comp.programming)