473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

cannot include <fstream>

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
4 4815
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Armando | last post by:
Hallo ! I habe some error in my programm,because i use <fstream.h>,I want to use <fstream> but i donīt know which fonctions i must modify in my program ? Thanks you for your help. Armando.
11
by: Charles L | last post by:
I have read that the inclusion of <fstream.h> makes the inclusion of <iostream.h> unnecessary. Is this correct? Charles L
1
by: Macca | last post by:
Hi, I have been using <fstream.h> in stdafx.h,(i'm using MFC) to output to text files. I have now started to use vectors and when i added #include <vector> using namespace std; to...
4
by: Falos425 | last post by:
Okay, I've got a driver.cpp, a section.cpp, and a section.h because I've got a 'section' class. I have an #include <fstream> in the section.h and then section.cpp has an #include "section.h" ...
4
by: adamrobillard | last post by:
Hi, I have always used fopen and FILE* to load and save structures to file. I am trying to convert all the older code to use proper C++ calls... the following code works properly but I would...
5
by: neowillis | last post by:
code: #include <iostream> #include <fstream> #include <string> using namespace std; int main() {
2
by: subramanian100in | last post by:
Consider the following piece of code: #include <iostream> #include <fstream> #include <vector> #include <string> #include <utility> #include <iterator> #include <algorithm> int main()
4
by: james.lawton | last post by:
Hi, I'm having a problem that I can't diagnose. I'm creating istreams of unknown types, and want to manage them on the stack, co I'm passing around ownership-holding pointers. Usually, I would...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.