Another wrinkle....

I'm trying to recompile some old code that was formerly working under vs6, and I'm not having any luck in vs2003. Specifically,
#include <strstrea.h> #include <fstream.h> However, the error I get is "Cannot open include file: 'strstrea.h': No such file or directory". I have other C library includes that work okay (e.g. <stdio.h>) so I'm not sure what else to try. Any Thoughts? And, yes, it's been quite a few years since I've looked at a line of c or c++ code.
[500 byte] By [nobodyman] at [2008-2-3]
# 1

Try the following in Visual C++ 2003:

#include <strstream>
#include <fstream>

For the 2003 release we got rid of the old iostream implementation so you need to use the new implementation. You should note that the new implementation is in the std namespace so you may need to add:

using namespace std;

to your code.

JonathanCaves at 2007-9-8 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 2

Hi Jonathan,
Many thanks for your reply. Unfortunately there's another wrinkl in that my code only uses iostream indirectly. My code #includes .h files written by a third-party, and those files have the old iostream includes.
I'm not opposed to mucking around with these third-party header files, but ultimately I can't modify the libraries I'll be linking against. So, my two followup questions would be
  • Is migrating from the old iostream implementation to the new iostream implementation a transparent change as far as the old code that uses iostream?
  • Seeing as how the third-party libraries were compiled using the old iostream library, am I going to run into trouble at link time?
In short... do I need to dig up my old vc6 cd's? Please say no... I think they're in my attic. Again thanks for all of your help so far. Definitely saved me some time spinning my wheels.
nobodyman at 2007-9-8 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 3

Is migrating from the old iostream implementation to the new iostream implementation a transparent change as far as the old code that uses iostream?

While converting from iostream.h to iostream might be as simple as re-compile there are quite a few differences between the two implementations so some source changes may be necessary. Here's a link to an article that describes the differences:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_Differences_in_iostream_implementation.asp

Seeing as how the third-party libraries were compiled using the old iostream library, am I going to run into trouble at link time?

You should be able to link the two libraries, especially as the iostream.h implementation was not in the std namespace (or any namespace), so there should be no names clashes at link time. A bigger problem though will be at runtime: both iostream implementations are going to be competing for the same underlying console so some serialization code may be necessary to ensure that they both don't attempt to write to the same stream at the same time.

I hope this helps

JonathanCaves at 2007-9-8 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 4
I hope this helps

Definitely! I'll check it out and see how it goes, but at the very least its more info than I had before. Thanks again.

nobodyman at 2007-9-8 > top of Msdn Tech,Visual C++,Visual C++ Language...