cannot include <fstream>

N

nils

Hi all,

Recently I started migrating a gcc project to Visual Studio C++ (dotnet).
The problem is that I cannot include any iostream header-file:

#include <fstream>
int main (int argc, char * argv)
{
printf("hello world");
return 0;
}

This will result in the following compilation error:

D:\TEMP\dotnettest>cl test.C
Microsoft (R) 32-bit C/C++ Standard Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

test.C
test.C(1) : fatal error C1083: Cannot open include file: 'fstream': No such
file or directory


After investigation, it seems that on my whole system, none of the following
files is available: iostream, fstream, ios. I have installed the .net
framework 1.1, and the CORE-Platform-SDK. The latter should contain the
headerfiles, doesn't it?

==> Do I have a corrupt installation, or is there another problem?

I'd appreciate it, if someone could point me in the right direction,

Thanks,

Nils
 
S

Sven Groot

nils said:
After investigation, it seems that on my whole system, none of the
following files is available: iostream, fstream, ios. I have
installed the .net framework 1.1, and the CORE-Platform-SDK. The
latter should contain the headerfiles, doesn't it?

==> Do I have a corrupt installation, or is there another problem?

This is off topic here, but I'll answer anyway.

The problem is that you don't have Visual C++. You have the .Net Framework
SDK, which indeed comes with a C++ compiler. But this version of the
Microsoft C++ compiler is intended only for creating Managed C++
applications, not for creating normal unmanaged applications. Although it is
capable of doing it (it is, after all, the same compiler that ships with
Visual C++ .Net 2003 Standard Edition) it does not have the ability to
optimise (because it's the Standard Edition) and it doesn't come with an
implementation of the Standard C/C++ Libraries.

So you can't use this compiler for creating 'normal' C++ applications of any
real use. You must either purchase Visual C++ .Net 2003 Standard Edition,
Visual Studio .Net 2003 (any edition), or switch to another free compiler
like g++.
 
S

Sven Groot

Sven said:
The problem is that you don't have Visual C++. You have the .Net
Framework SDK, which indeed comes with a C++ compiler. But this
version of the Microsoft C++ compiler is intended only for creating
Managed C++ applications, not for creating normal unmanaged
applications. Although it is capable of doing it (it is, after all,
the same compiler that ships with Visual C++ .Net 2003 Standard
Edition) it does not have the ability to optimise (because it's the
Standard Edition) and it doesn't come with an implementation of the
Standard C/C++ Libraries.
So you can't use this compiler for creating 'normal' C++ applications
of any real use. You must either purchase Visual C++ .Net 2003
Standard Edition, Visual Studio .Net 2003 (any edition), or switch to
another free compiler like g++.

And on a final note, I just saw this download on MSDN:
http://msdn.microsoft.com/visualc/vctoolkit2003/

It's probably what you want.
 
N

nils

Thanx Sven! I'l give it a try.

Nils

Sven Groot said:
This is off topic here, but I'll answer anyway.

The problem is that you don't have Visual C++. You have the .Net Framework
SDK, which indeed comes with a C++ compiler. But this version of the
Microsoft C++ compiler is intended only for creating Managed C++
applications, not for creating normal unmanaged applications. Although it is
capable of doing it (it is, after all, the same compiler that ships with
Visual C++ .Net 2003 Standard Edition) it does not have the ability to
optimise (because it's the Standard Edition) and it doesn't come with an
implementation of the Standard C/C++ Libraries.

So you can't use this compiler for creating 'normal' C++ applications of any
real use. You must either purchase Visual C++ .Net 2003 Standard Edition,
Visual Studio .Net 2003 (any edition), or switch to another free compiler
like g++.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top