Solved

Header File

Posted on 1998-09-09
3
178 Views
Last Modified: 2010-04-02
I am using #include<fstream.h>  in my C++ program. compile error says that fstream.h not found, because it is not in /usr/include.

means,I have C compiler on my machine but not that header file.
why??????how to get?????
from where I can get that file
0
Comment
Question by:anilkumarv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Expert Comment

by:WxW
ID: 1172426
Linux ( or other UNIX implementations , as I might understood from your /usr/include ) probably do not have the fstream.h I don't know why , but I have this file ... if you want me to mail it .... mail to xmic@freemail.gr

P.S. Since you work on UNIX platforms , there is no guarantee that my file should work on your system .

0
 
LVL 11

Accepted Solution

by:
alexo earned 10 total points
ID: 1172427
The /usr/include probably means you have a unix machine.

First, you have to make sure you have a C++ compiler on your machine.  A C compiler will not compile a C++ program no matter how nicely you ask.

Second, the newer C++ compilers follow the standard's practice of ommiting the .h suffix on the standard include files.  Try #include <fstream> instead.

Third, the include files may reside on a different directory.  Search your disk for fstream or fstream.h and tell the compiler to use the directory one of those files resides in as its include directory.  It can be done using a command-line switch (usually -i or -I) or an environment variable, depends on your compiler.
0
 

Author Comment

by:anilkumarv
ID: 1172428
Thanks, alexo
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question