473,505 Members | 16,940 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

include problem

I am a newbie with C++ and unable to understand this warning/error
message :

localhost > g++ -Wall j++.cpp
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
from j++.cpp:2:
/usr/include/c++/3.2.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.

The offending line is :
#include <iostream.h>

The compiler is GNU C/C++ version : 3.2.2.3
Host OS is : Mandrake Linux 9.1

All help welcome....
Jul 19 '05 #1
3 7998
skumar escribió:
The offending line is :
#include <iostream.h>


It tell you that <iostream.h> is a pre-standard form, and you must use
<iostream> instead.

Find a more recent C++ book or tutorial than you have actually.

Regards.
Jul 19 '05 #2

"skumar" <s_*******@rediffmail.com> wrote in message news:a0**************************@posting.google.c om...
#include <iostream.h>

This header is not part of standard C++. It is for G++ an obsolete header. The standard
header is called <iostream>. This defines the stream stuff into the std namespace as well.
This means that in addtition to changing the header you must place explicitly qualify the
stuff from that header (std::cout for example) or bring then into the current context with
using directives (using std::cout or even using namespace std). Do not place using directives
in headers that you expect others to use. It's not nice to pollute their namespace. Stick
to the explicit qualification in headers.
Jul 19 '05 #3
"skumar" <s_*******@rediffmail.com> wrote in message
news:a0**************************@posting.google.c om...
I am a newbie with C++ and unable to understand this warning/error
message :

localhost > g++ -Wall j++.cpp
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
from j++.cpp:2:
/usr/include/c++/3.2.2/backward/backward_warning.h:32:2: warning:
#warning This file includes at least one deprecated or antiquated
header.
This is true. <iostream.h> is a header from before
C++ was standardized. So it's 'antiquated' rather
than 'deprecated'. 'Deprecated' means it's still
officially standard, but that a more 'modern' form
is preferred.

In standard C++, none of the standard headers (except
for some C library headers which are deprecated), have
a ".h" in their names. The *only* valid standard header
for declaring the standard stream objects is <iostream>.
No. '.h'.

All the identifiers in the C++ library (except macros
and C identifiers declared in the deprecated '.h' headers)
are declared inside namespace 'std', so you need to qualify them
when using them (with 'using' directives or declarations,
or explicit qualification).
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>.
This is what you need to do.
Change <iostream.h> to <iostream>, and get the
identifiers from namespace 'std'.

BTW That last part of the warning message is technically
incorrect. <strstream.h> is not and never has been part
of standard C++, so it cannot be 'deprecated'.

Many implemenations provide prestandard headers such
as <iostream.h> for 'backward compatibility' do that
legacy code can still be used. New code should use
the standard headers.

To disable this warning use
-Wno-deprecated.

The offending line is :
#include <iostream.h>

The compiler is GNU C/C++ version : 3.2.2.3
Host OS is : Mandrake Linux 9.1

All help welcome....


#include <iostream>
using namespace std; /* only use this form for simple */
/* or example programs */
int main()
{
cout << "Hello standard C++\n";
return 0;
}

More about this issue can be seen in a good (modern)
C++ text, and in the C++ FAQ:
http://www.parashift.com/c++-faq-lite/
See item 27.4 (But read the whole FAQ, you'll
be glad you did. :-) )

-Mike
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
2975
by: Yannick Turgeon | last post by:
Oups! I did a typing error in my last post. Fixed. ----------- Hello all, We are currently changing our web server and, in the process, updating PHP version from 4.3.0 to 4.3.5. The problem...
43
5042
by: steve | last post by:
I am quite frustrated with php’s include, as I have spent a ton of time on it already... anyone can tell me why it was designed like this (or something I don’t get)? The path in include is...
6
7048
by: alan | last post by:
Dear all, I have written my own function by C. And my development platform is W2k with VC6.0. Then I also defined a header file to extern declare this function. After that, I include this...
6
9564
by: atv | last post by:
Alright, i have some questions concerning include files en global variables.I hope someone is willing to answer these. 1).Why is it that if i define a global variable in a file, say main.c, and...
60
8210
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header...
5
2495
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
0
1194
by: Francois | last post by:
Hi, I think I found a bug with VS, and I've included a project example of the problem I got. I've got a project deep into a set of folders. The project have an additional include library...
3
2690
by: Arpi Jakab | last post by:
I have a main project that depends on projects A and B. The main project's additional include directories list is: ...\ProjectA\Dist\Include ...\ProjectB\Dist\Include Each of the include...
6
2092
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file =...
5
2205
by: Tio | last post by:
I have project in MFC(vc++) . There are files and classes: classes:dialog1,dialog2,aaa,bbb ---------------------- main.cpp --------------------- #include "mainfrm.h" #include "dialog1.h"...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4701
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.