www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/20/00:21:26

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: C++ code doesn't compile
Date: Thu, 19 Mar 1998 19:37:48 -0500
Organization: Two pounds of chaos and a pinch of salt.
Lines: 30
Message-ID: <3511BA5C.5EC9@cs.com>
References: <35119A81 DOT 8D281715 AT netins DOT net>
NNTP-Posting-Host: ppp210.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Scott Billings wrote:
> 
> Well, that's not entirely true, it just won't compile using GCC. If I
> use something like GPP or G++ it will.

*sigh*.  There's an old story that someone on here once posted.  A man
goes to the doctor and says, "Doctor, it hurts when I do this."  The
doctor replies, "Well, don't do that then."  The moral (however dubious)
applies equally to this situation.

gcc only knows about the C library.  It does not have the slightest idea
when it gets to the linking stage what language your program was written
in.  If you study how the compiler operates, this should be obvious. 
Since it makes no sense to link the C++ libraries into a C program, you
have to specify them manually if you want to use plain 'gcc'.

To make things easier for programmers, the GNU developers wrote a handy
little wrapper program called 'g++' (called 'gxx' or 'gpp' on MS-DOS)
that automatically appends the C++ libraries to the command line of
'gcc'.  This was done to save effort on your part.

Why are you complaining about this?  :-)

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Autocracy is based on the assumption|
|       aka Fighteer I       | that one man is wiser than a million |
|   mailto:fighteer AT cs DOT com   | men.  Let's play that over again,    |
| http://www.cs.com/fighteer | too.  Who decides?"   - Lazarus Long |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019