Visual .net 2003 can't find iostream.h
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.
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 poleNot all, only STL include files.
Does that mean just dropping the .h from all include files and adding "using namespace std" under them?
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.
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]
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]
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
Popular Topics
Advertisement