Fw: GCC - help needed

the oPeR4T0r david.wolf@virgin.net
Tue Sep 12 08:12:00 GMT 2000


 
-----Original 
Message----- From: the oPeR4T0r < david.wolf@virgin.net > To: 
gnu@gnu.org < gnu@gnu.org > Date: 29 August 2000 
19:59 Subject: GCC - help needed
Hi,
    I'm not sure if this is the right address to be 
sending my boring questions, but if it isn't, could you please forward it to 
whoever could help me.
 
My 
question is this - when I use gcc to compile this:
 
=main.cpp===================
#include 
<iostream.h>
 
int 
main() {  cout<<"Hello World\n"; return 
0; }
=EOF========================
 
and then compile it with
 
=compile.bat================
gcc main.cpp -o 
main.exe

=EOF========================
 
I get:
 
========================
c:/djgpp/tmp\cc3G1Lyh.o(.text+0x1f):main.cpp: undefined 
reference to 'cout'
c:/djgpp/tmp\cc3G1Lyh.o(.text+0x24):main.cpp: undefined 
reference to 'ostream::operator<<(char const *)'
collect2: ld returned 1 exit status
========================
(this might not be 
completely accurate as I copied it by hand)
 
now I've tried adding "using namespace std;" 
to line 2 of main.cpp, but nothing changed
 
I have the same problem with gcc in linux, but with g++ 
it compiles fine
 
I've heard that it could have something to do with 
makefiles, but I'm unsure
 
could you help me out?
 
thanks,
Adam
    xx
 



More information about the Gcc-help mailing list