delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/10/16/08:58:52

From: cwilson AT ee DOT gatech DOT edu (Charles Wilson)
Subject: Re: BUG: egcs-1.1-mingw32 - gcc -o hello hello.C
16 Oct 1998 08:58:52 -0700 :
Message-ID: <3626408A.E9CB5065.cygnus.gnu-win32@ece.gatech.edu>
References: <Pine DOT SUN DOT 3 DOT 93 DOT 981014110606 DOT 10933F-100000 AT modi DOT xraylith DOT wisc DOT edu>
Mime-Version: 1.0
To: Mumit Khan <khan AT xraylith DOT wisc DOT edu>
Cc: Earnie Boyd <earnie_boyd AT yahoo DOT com>, gw32 <gnu-win32 AT cygnus DOT com>

Mumit Khan wrote:

> On Wed, 14 Oct 1998, Earnie Boyd wrote:
>
> > When giving this command with mingw32 version of egcs-1.1 the stdc++
> > library isn't properly included at the execution of ld.  This is the
> > only problem with this command.
> >
> > g++ -o hello hello.C will properly add the library.
> >
>
> Hi Earnie,
>
> I'm a bit confused ... "gcc" is the C driver, and "g++" or "c++" is the
> C++ driver. "gcc" will not and should not C++ specific libraries, and the
> only correct and portable way to link C++ programs is to use the "c++" or
> "g++" driver. If "gcc" adds C++ specific libraries, it's a bug, not a
> feature.
>
> Correct way to link C++ programs:
>
>   $ c++ -o hello hello.cc
>
> (or alternatively use g++, which is just a link to c++).
>

<snip>

Up until recently, I believe that gcc when called on a c++ source file,
would call g++, and everything would be fine. This broke at gcc 2.8.0 on
HP-UX, so now you have to call g++ explicitly. I don't know the heritage of
egcs, but it could have inherited this behavior, and thus (egcs) gcc does
not helpfully call (egcs) g++ for you.

--Chuck


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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