From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021002 Description of problem: The following file compiles: #include <ostream.h> ostream& operator<< (ostream&, int); but gives the warning: In file included from /usr/include/c++/3.2/backward/ostream.h:31, from try.C:1: /usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated. If I change <ostream.h> to <ostream> however, I get: try.C:3: syntax error before `&' token Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.c++ -c file.C with above files 2. 3. Actual Results: See above Expected Results: Should compile ? Additional info: None
The compiler is right, your program is not ISO C++. #include <ostream> std::ostream& operator<< (std::ostream&, int); is. Or you could add using namespace std; or using std::ostream; after your includes.
Wow, that was quick. Thanks. I see now that converting my entire tree to new style headers is going to involve more than just a few streamedits.