From: donho AT altern DOT org (Don HO) Newsgroups: comp.os.msdos.djgpp Subject: Re: My GCC does not compile the C++ source Message-ID: <398fd8ba.550102@news.free.fr> References: <398f215c DOT 35904767 AT news DOT free DOT fr> <833dkgwzxb DOT fsf AT mercury DOT bitbucket> X-Newsreader: Forte Free Agent 1.11/32.235 Lines: 57 Date: Tue, 08 Aug 2000 09:55:38 GMT NNTP-Posting-Host: 212.27.44.52 X-Complaints-To: abuse AT proxad DOT net X-Trace: nnrp5.proxad.net 965728538 212.27.44.52 (Tue, 08 Aug 2000 11:55:38 CEST) NNTP-Posting-Date: Tue, 08 Aug 2000 11:55:38 CEST Organization: Guest of ProXad - France To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Thanx for your help. I do add "using namespace std;", but it gives me : ccaa.cc:2: warning: namespaces are mostly broken in this version of g++ d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x2f):ccaa.cc: undefined reference to `cin' d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x34):ccaa.cc: undefined reference to `istream::operator>>(int &)' d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x3e):ccaa.cc: undefined reference to `endl(ostream &)' d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x51):ccaa.cc: undefined reference to `cout' d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x56):ccaa.cc: undefined reference to `ostream::operator<<(char const *)' d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x61):ccaa.cc: undefined reference to `ostream::operator<<(int)' d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x6c):ccaa.cc: undefined reference to `ostream::operator<<(char const *)' d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x77):ccaa.cc: undefined reference to `ostream::operator<<(ostream &(*)(ostream &))' It doesn't compile! On Tue, 08 Aug 2000 00:53:07 GMT, Damian Yerrick wrote: >On 07 Aug 2000 13:59:12 -0700, Nate Eldredge >wrote: > >>donho AT altern DOT org (Don HO) writes: >> >>> But it doesn't work with this one : >>> >>> #include > > using namespace std; > >>> int main() { >>> int x; >>> cin >> x; >>> cout << "Hello, World! I am " << x << " Today!" << endl; >>> } >> >>Use the command `gpp' to compile C++, instead of `gcc'. > >That, and you forgot to `using' the `std' namespace. > >-- >Damian Yerrick >"I refuse to listen to those who refuse to listen to reason." >See the whole sig: http://www.rose-hulman.edu/~yerricde/sig.html > >This is McAfee VirusScan. Add these two lines to your signature to >prevent the spread of signature viruses. http://www.mcafee.com/ Je bouffe donc je chie