Visual .net 2003 can't find iostream.h

Started by
8 comments, last by maxplus305 19 years, 12 months ago
OK, when compiling a simple program with the .NET 2003 suite, I get: c:\Programs\NUTron\NUTron.cpp(4): fatal error C1083: Cannot open include file: ''iostream.h'': No such file or directory The relevant code is this: #include <windows.h> #include <math.h> #include <stdlib.h> #include <iostream.h> What am I missing here? I haven''t screwed around too much with the settings of .NET.
Advertisement
iostream.h is pre-standard C++. MSVC .NET 2003 dropped support for it. You''ll need to migrate your code to use the standard <iostream> header. And don''t forget that its contents live in namespace std.
Does that mean just dropping the .h from all include files and adding "using namespace std" under them?

quote:Original post by tad pole
Does that mean just dropping the .h from all include files and adding "using namespace std" under them?
Not all, only STL include files.
quote:Original post by alnite
Not all, only STL include files.

iostream.h was not an STL include file. Neither was fstream.h, iomanip.h, ios.h, istream.h, ostream.h, streamb.h, and strstrea.h, all of which are dropped in MSVC .NET 2003.

Nor are their interfaces the same. The new iostream headers do not take a protection parameter when calling open(), cannot create streams from handles, does not support ios::nocreate or ios::noreplace, etc.

@maxplus305: I don''t think that you want to be doing a local function declaration. You''re trying to call the Initialize() function, right? If so, then drop the int and the char ** from the function call.
You know, SiCrane, that might be a beneficial side-effect of MS offering VC7.1 for free.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
quote:Original post by alnite
Not all, only STL include files.


Actually, from all C++ include files. C header files lose the '.h' and gain a 'c' prefix.

C: stdlib.h → C++: cstdlib
C: stdio.h → C++: cstdio
C: math.h → C++: cmath
C: string.h → C++: cstring
C: ctype.h → C++: cctype

And everything is, at least theoretically, placed in the std namespace, except, obviously, for things like #defines (which, in all honesty, should not be even considered, since they are not - in theory - handled by the compiler), and the global ::operator new and its kin and other arcane components completely irrelevant to us mortals who are not nazi moderators.

[edited by - Fruny on April 21, 2004 12:10:34 AM]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
quote:Original post by Fruny
You know, SiCrane, that might be a beneficial side-effect of MS offering VC7.1 for free.

As nice as that utopia might be, first, we have to switch over all the articles and tutorials to use the new style headers. *cough* Finishthearticle *cough*

And to be fair, I believe maxplus305 has had MSVC .NET 2003 since at least February.

quote:Original post by Fruny
And everything is, at least theoretically, placed in the std namespace.

*cough* #defines *cough* ::operator new *cough*

[edited by - SiCrane on April 21, 2004 12:00:31 AM]
*puts fingers in his ears*

La la la, I can''t hear you.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Dammit Fruny, why''d you have to be the first to call SiCrane a nazi mod... then again, maybe it''s just as well you got to it first instead of some n00b

This topic is closed to new replies.

Advertisement