ok, let me start this off by saying i'm very new to linux, i'm using debian 2.4.27/-3-386.
im trying to setup an environment that i can compile some very basic C code in. all i want to do right now is read in a file... using the fstream.h
i have downloaded and installed the libc6.dev package...
when i am in the directory my C file lies in and run gcc to compile it.. i get a bunch of errors, first off the bad is that it cant find the fstream.h file.. so i found the path for it.. and put it in my include statement and then the compiler yelled at me for one of the first lines in fstream.h
i'm used to a windows environment and i really am shooting in the dark, all i want to do is compile a very basic C program nothign fancy.. ANY help would be appreciated...
remember
NEWBIE!
thanks in advance
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
newbie trying to setup VERY SIMPLE C environment
Look at http://www.daniweb.com/techtalkforums/thread11430.html - you will see that you need to include 'fstream', not 'fstream.h'. Also I believe fstream is C++, not C - correct me if I'm wrong.
-
- Posts: 13
- Joined: 2006-10-05 22:49
filestream.h is used in c++, not c. So you need to use g++ to compile it.
Code: Select all
#include <fstream>
int main(void){
ifstream in("somefile");
while(!in.eof()) {
//do something
}
in.close();
}
Code: Select all
$ g++ yourfile.cpp -o executible_name
-
- Posts: 13
- Joined: 2006-10-05 22:49