C++ iostream - getting "deprecated header" error
I have a simple program I am using to explore typedef and structs more:
Code:
// /usr/include/c++/3.3/backward/iostream.h I compile with Quote:
/usr/include/c++/3.3/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. I did a Code:
find / -name iostream.h |
Just do #include <iostream> instead of #include <iostream.h>. It's not a matter of using the incorrect header, it's a matter of including the header correctly :)
|
Futhermore add
using namespace std; like : #include <iostream> #include <list> using namespace std; int main () { .... } |
Thanks for the response. Could someone explain 'why' the declaration is incorrect and 'how' Linux utilizies these libraries. Also, is the iostream I found using the find function the one being used in the program? Where are Linux libraries usually stored. I am more interested in learning what is happening here rather than the syntax, although I appreciate the help on that too! Thanks.
|
All times are GMT -5. The time now is 05:52 PM. |