How to use old iostream.h in C ++ (Visual Studio 2010)

I have a Microsoft Visual C ++ 6.0 project and successfully converted it to MS VS Professional 2010 Trial. There were no conversion issues. However, when creating a converted project, he tells me that "iostream.h" cannot be found.

I am aware of the new standardized "iostream" and the "use of the std namespace definition".

But I need to use the old iostream.h. Is there any way to do this? The reason is because this project relies on the old old lib using the old iostream.h.

Any suggestions?

+4
source share
3 answers

If you have source code based on iostream.h, modify it. If you have source code that you absolutely cannot change, write iostream.h yourself:

#include <iostream> using namespace std; 

A static library cannot rely on a header file. The header file is included in the source code or other header files, the static library consists of object code. However, library header files may depend on iostream.h. The library itself may depend on the standard C ++ library. I assume that there have been incompatible changes to the Microsoft standard library with MSVC 6.0, so if you don't have the source code or a newer version of your static library, you're probably out of luck.

+4
source

Do you use precompiled headers? If so, then you need to include iostream.h in the stdafx.h file or remove the precompiled headers. In any case, it makes no sense to use the deprecated iostream.h instead of iostream , so maybe you need to change the parts of the code that need the old version (if so).

0
source

Replace

 #include <iostream.h> 

with

 using namespace std; #include <iostream> 
0
source

Source: https://habr.com/ru/post/1386345/


All Articles