Link to home
Start Free TrialLog in
Avatar of hari4130
hari4130

asked on

'_OLD_IOSTREAMS_ARE_DEPRECATED' warning in Visual C++ .NET

When i try to build my C++ Code (written in VS 6.0), on VS .NET I get the following warning, which occurs with the .NET include library.
I do not get this warning when i build on VS 6.0

C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) : warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was marked as #pragma deprecated

I also see no reference to "iostream" header file in any of my code.

Can anyone tell me how to get rid of this warning.

Thanks
Avatar of Axter
Axter
Flag of United States of America image

Hi hari4130,
> >I also see no reference to "iostream" header file in any of my code.

Look for any STD headers that are using *.h extension.
These files are not part of the C++ standard, and should not be used.
To get rid of the error, just modify your code so that you're using the extensionless version.

If you're not using <iostream.h>, you could be using another *.h header that is calling <iostream.h>

Look for files like the following:
#include <fstream.h>
#include <sstream.h>
#include <ios.h>
If you find any of the above files, convert it to extensionless version.
#include <fstream>
//You also might need to add using namespace std
using namespace std;


David Maisonave :-)
Cheers!
ASKER CERTIFIED SOLUTION
Avatar of Axter
Axter
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial