473,666 Members | 2,138 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trouble including "iostream" "fstream"

I am having some trouble including "iostream" "fstream" to my code.

I tried the following ways and base times it did not work. What is the
problem?

test.cc:
=======
.....
#include <iostream.h>
#include <fstream.h>
......

g++ test.cc test.cc:8: iostream.h: No such file or directory
test.cc:9: fstream.h: No such file or directory
gcc test.cc test.cc:8: iostream.h: No such file or directory
test.cc:9: fstream.h: No such file or directory


test.cc:
=======
.....
#include <iostream>
#include <fstream>
using namespace std;
using std::cout;
......
.....

g++ test.cc test.cc:8: iostream.h: No such file or directory
test.cc:9: fstream.h: No such file or directory
gcc test.cc

test.cc:8: iostream.h: No such file or directory
test.cc:9: fstream.h: No such file or directory

Jan 17 '06 #1
2 7147
cut and past problem... The second scenario is as below:
test.cc:
=======
.....
#include <iostream>
#include <fstream>
using namespace std;
using std::cout;
......
.....
g++ test.cc
test.cc:8: iostream: No such file or directory
test.cc:9: fstream: No such file or directory
gcc test.cc


test.cc:8: iostream: No such file or directory
test.cc:9: fstream: No such file or directory

Jan 17 '06 #2
NewToCPP wrote:
cut and past problem... The second scenario is as below:
test.cc:
=======
....
#include <iostream>
#include <fstream>
using namespace std;
using std::cout;
.....
....

g++ test.cc

test.cc:8: iostream: No such file or directory
test.cc:9: fstream: No such file or directory

gcc test.cc

test.cc:8: iostream: No such file or directory
test.cc:9: fstream: No such file or directory


This is OT. Your installation is apparently defective. Ask for help
in gnu.g++.help.

V
Jan 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4001
by: Christopher Reeve | last post by:
Hi, I wonder if anyone could help me. I am moving accross from C to C++ and am writing a program that reads and writes data into a file. I am aware of the old C ways of doing it but am trying to use the C++ functions which don't seem to be working propperly. I need to open the file for reading and writing because I want to search for a possition in a file called settings.dat and then write a number after a certain chatacter. However when...
10
6719
by: Dave O'Hearn | last post by:
I want to open a file for both reading and writing, but when I do "ios::in|ios::out" with an fstream, it creates the file if it doesn't already exist. I don't like that last part. C's fopen has the "r+" mode, where the file will open for reading "+ also writing", but it will not create a new file if one isn't already there; it fails with an error. POSIX also has this behavior with it's 'open' call, you just leave the 'create' bit out, and...
3
1492
by: Griff | last post by:
#include <iostream> using namespace std; #include <vector> #include <string> #include <fstream> #include <algorithm> template<class C>void PrintAll(C&v) {
7
5549
by: jccorreu | last post by:
I've got to read info from multiple files that will be given to me. I know the format and what the data is. The thing is each time we run the program we may be using a differnt number of files, with different file names each time. So i'm writing into the code to ask the user how many files, and what their names are. From each we'll read in 2 lines, then do some math using all of those lines. Then do it again on another set of lines. ...
1
13587
by: Robbie Hatley | last post by:
Say I have an ifstream object, like so: #include <iostream> #include <fstream> int main(int, char* Sam) { std::ifstream Bob; Bob.open(Sam); std::string buffer; while (42)
9
3377
by: Xian | last post by:
Is there a right and proper (tm) way to end a line? Thinking about portability and the mess that the 'wrong' line endings can cause. E.g. std::cout << "Hello World!\n"; or std::cout << "Hello World!" << std::cout; -- /Xian
9
4987
by: Robin | last post by:
// Pls note that test.txt exists. #include <iostream> #include <fstream> #include <string> using namespace std; int main() { fstream fs("test.txt", ios_base::in | ios_base::app);
23
4857
by: mahesh | last post by:
Hi all, I have following code that is supposed to increase the power by specified value. int main() { system("cls"); int i, exponent; double base; double new_base=0.0;
2
2254
by: mauricesmith42 | last post by:
Sorry i know this is rather large to be posting, but in order to understand the question you have to see all the code //#include <windows.h> //needed for opening folders #include <stdlib.h> //needed for converting integers to strings #include <iostream> //needed for in/out commands ie. cin/cout #include <fstream> //needed to open readable/writeable files ie. ifstream/ofstream #include <string> //needed to create strings from...
0
8871
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8640
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.