954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Deprecated Or Antiquated Header

I'm including these three files in my C++ program:

#include <stdio.h>
#include <cstdlib>
#include <iostream.h>


The C++ compiler I am using (Dev-C++ 4.9.9.2) Allows me to run this program. but I still receive an error message saying:

#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 <iostream> instead of the deprecated header \
<iostream.h>. To disable this warning use -Wno-deprecated.


Why is this happening and how can I stop it? Thanks in advance.

DanDaMan
Newbie Poster
13 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

use cstdio instead of stdio.h and iostream instead of iostream.h

Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
 

i also had the same pblm and when i used cstdio instead of ,still the compiler was showing error.

NITHIN VIJAY
Newbie Poster
1 post since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

What compiler are you using?

NathanOliver
Veteran Poster
1,084 posts since Apr 2009
Reputation Points: 215
Solved Threads: 189
 

iostream.h is obsolete. use instead (notice there is no .h extension).

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

You can replace all three headers with
#include

wavsyntax
Newbie Poster
8 posts since May 2009
Reputation Points: 6
Solved Threads: 0
 

Mine is showing these three errors

1 C:\Dev-Cpp\include\c++\3.4.2\backward\iostream.h:31, from C:\Users\Home\Documents\ATM.cpp In file included from C:/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31, from C:\Users\Home\Documents\ATM.cpp
1 C:\Users\Home\Documents\ATM.cpp from C:\Users\Home\Documents\ATM.cpp
32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h #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 <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.

cplusplus.plus
Newbie Poster
1 post since May 2012
Reputation Points: 0
Solved Threads: 0
 

For future reference, errors and warnings are not synonymous. Errors must be fixed because they halt compilation. Warnings can be ignored, though in some cases they suggest problems that are likely to occur at runtime.

Since your compiler clearly supports the modern headers, it's recommended that you use them.

deceptikon
Indubitably
Administrator
632 posts since Jan 2012
Reputation Points: 119
Solved Threads: 105
 

I ALWAYS treat warnings in my own code as errors because most of the time they are errors. We need to know which header files cplusplus is using before we can suggest a solution to fix them.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Post: Markdown Syntax: Formatting Help
You