Re: Mistake With CPP File

Robert Schiele <[email protected]>
Newsgroups org.kernel.vger.linux-gcc
Message-ID <[email protected]>
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".

Robert

-- 
Robert Schiele			Tel.: +49-621-181-2517
Dipl.-Wirtsch.informatiker	mailto:[email protected]
signature.asc (application/pgp-signature, 524 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iQEVAwUBPUjerMQAnns5HcHpAQHpsQgAhIyoOBbQvnt3RifrVYCcfzQqlZ8R9EbV
Js5MkEVASgt7xj1EGrTonCd4uKDo+1pbcZZQaHzInEJwfQTSb6BOYbBu3JVdl73n
EjkKTe7YORvbUk6+iyq8nwEEiGLp4XpdHAhkpSov/iJHHHbNbOo/6a5LOgotWIlK
SHKf4C8xqFLkrtRUZLQ3/QOhdeyUphJ9/qjuM+QV07U/IMxCDVFzXqFp3ZDIq/LO
Sc0RopMsRE00R3OekomJEUa65Wd14Td1BYRhmFXfbRp1vZDWsxKrmWfcpw8gqp9j
OI1bN+8Qqj3JjqNWpyUFC8PNKQa4FndS71U965N0mE7NAaE1CWWNzQ==
=fr+q
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.