Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use the old iostream.h in C++ (Visual Studio 2010)

I have a Microsoft Visual C++ 6.0 Project and converted it successfully with MS VS Professional 2010 Trial. No conversion problems occured. However, when building the converted project it tells me, that "iostream.h" cannot be found.

I am aware of the new and standardized "iostream" and the "using namespace std" fix.

But I need to use the old iostream.h. Is there a way to accomplish that? The reason is, that this project relies on an old static lib using the old iostream.h.

Any suggestions?

like image 437
Jane Avatar asked Oct 10 '22 05:10

Jane


1 Answers

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

#include <iostream>
using namespace std;

A static library cannot possibly rely on a header file. A header file is included by source code or other header files, the static library consists of object code. The library's header files can depend on iostream.h, though. The library itself can depend on the C++ standard library. I assume that there have been incompatible changes to Microsoft's standard library since MSVC 6.0, so if you do not have source code or a newer version of your static library, then you are probably out of luck.

like image 140
wolfgang Avatar answered Oct 13 '22 12:10

wolfgang