Mail Archives: djgpp/1997/11/05/21:01:29
From: | "John M. Aldrich" <fighteer AT cs DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Compile and link C++ program
|
Date: | Thu, 06 Nov 1997 06:45:48 +0000
|
Organization: | Two pounds of chaos and a pinch of salt
|
Lines: | 29
|
Message-ID: | <3461679C.6A35@cs.com>
|
References: | <63qn2c$e86$1 AT news DOT kth DOT se>
|
Reply-To: | fighteer AT cs DOT com
|
NNTP-Posting-Host: | ppp227.cs.com
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Björn Landsberg wrote:
>
> I get the message "undefined reference to cout".
> If I use the -c option when I call gcc, wich skips the linking, I get no
> errors. I also tried -O wich I read somewhere.
>
> Whats wrong? Ive read the helpfiles and desperatley tried various
> combinations of different command-line arguments, without success.
Did you notice the file called 'readme.1st'? It specifically tells you
that when you compile C++ code you must link the C++ libraries, either
by adding '-lgcc' (or -liostr or -lstdcx) to the end of your command
line, or by substituting 'gxx' for 'gcc'. In RHIDE, if you give your
program a correct C++ filename, it should link the C++ libs
automatically.
This is also a Frequently Asked Question; see chapter 8.7 of the FAQ.
--
---------------------------------------------------------------------
| John M. Aldrich | "A committee is a life form with six |
| aka Fighteer I | or more legs and no brain." |
| mailto:fighteer AT cs DOT com | |
| http://www.cs.com/fighteer | - Lazarus Long |
---------------------------------------------------------------------
- Raw text -