By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,760 Members | 1,630 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,760 IT Pros & Developers. It's quick & easy.

cannot include <fstream>

P: n/a
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


Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
nils wrote:
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++.

--
Sven Groot
Nov 17 '05 #2

P: n/a
Sven Groot wrote:
nils wrote:
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.


Sorry, it is topical, I was under the impression I was in a different
newsgroup... ^_^

--
Sven Groot
Nov 17 '05 #3

P: n/a
Sven Groot wrote:
nils wrote:
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?


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.

--
Sven Groot
Nov 17 '05 #4

P: n/a
Thanx Sven! I'l give it a try.

Nils

"Sven Groot" <sv*******@gmx.net> wrote in message
news:um**************@TK2MSFTNGP12.phx.gbl...
nils wrote:
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++.

--
Sven Groot

Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.