Re: Mistake With CPP File
SoloCDM <[email protected]>
| Newsgroups | org.kernel.vger.linux-gcc |
|---|---|
| Message-ID | <[email protected]> |
Robert Schiele stated the following:
>
> On Wed, Jul 31, 2002 at 05:04:04AM -0600, SoloCDM wrote:
> > Recently I tried to compile fig01_02.cpp with Kernel 2.2.20 on Linux
> > Mandrake 8.0. I used "gcc fig01_02.cpp" and received the following
> > errors:
> >
> > <user_account>/tmp/ccmeDWKS.o: In function `main':
> > <user_account>/tmp/ccmeDWKS.o(.text+0xf): undefined reference to
> > `cout'
> > <user_account>/tmp/ccmeDWKS.o(.text+0x14): undefined reference to
> > `ostream::operator<<(char const *)'collect2: ld returned 1 exit status
> >
> > Why didn't it work?
>
> cout is in libstdc++. So either you have to call "g++ fig01_02.cpp" or
> "gcc -lstdc++ fig01_02.cpp".
It worked -- Thanks!
I couldn't help but notice how g++ linked all the way back to
colorgcc. Although, colorgcc doesn't react like g++. Colorgcc won't
create a.out.
What is gcc used for? I noticed it seems to have some of the same
files or libraries as g++.
--
Note: When you reply to this message, please include the mailing
list and/or newsgroup address and my email address in To:
*********************************************************************
Signed,
SoloCDM