Computing.Net > Forums > Programming > stream operators and gcc

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

stream operators and gcc

Reply to Message Icon

Name: Joseph
Date: May 19, 2003 at 13:47:11 Pacific
OS: Solaris
CPU/Ram: PIII 450, 256 mb
Comment:

Hi,

I am getting a ton of errors when i try to compile a c++ file using gcc. I am using this in my main.cpp

#include
#include
#include "top20.h"

using namespace std;
using std::string;


#define LISTFILE "C:\\IT\\Top User Project\\list.txt"


void main () {

ifstream inFile;

and the errors are coming for ifstream. It said that it is an undefined reference.

joe



Sponsored Link
Ads by Google

Response Number 1
Name: zzray
Date: May 19, 2003 at 18:16:04 Pacific
Reply:

hi,

I notice you said you are using gcc. You can only use gcc for C programs

Try compliling with g++ for c++ programs.

zzray



0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: stream operators and gcc

make and gcc with assembly www.computing.net/answers/programming/make-and-gcc-with-assembly/14117.html

math.h and gcc and linker error www.computing.net/answers/programming/mathh-and-gcc-and-linker-error/1154.html

visual C++ vs C++ and C www.computing.net/answers/programming/visual-c-vs-c-and-c/8925.html