Archived

This topic is now archived and is closed to further replies.

Visual .net 2003 can't find iostream.h

This topic is 4983 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites