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