delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/01/28/06:58:14

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Originating-IP: [150.101.116.69]
X-Originating-Email: [tilps AT hotmail DOT com]
X-Sender: tilps AT hotmail DOT com
From: "Gareth Pearce" <tilps AT hotmail DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: G++ for CygWin
Date: Wed, 28 Jan 2004 22:57:23 +1100
MIME-Version: 1.0
In-Reply-To: <NUTMEGCNCUgpCfZdEla00000031@NUTMEG.CAM.ARTIMI.COM>
Message-ID: <BAY2-DAV31ejcauaXyY0001b499@hotmail.com>
X-OriginalArrivalTime: 28 Jan 2004 11:57:28.0715 (UTC) FILETIME=[E721DDB0:01C3E595]
X-IsSubscribed: yes

> > (gnu separated out its frontend from its backend with v3.3)
> 
>   AFAIR, the only significant difference between gcc.exe and g++.exe is
> that
> gcc.exe assumes files are C by default, and hence calls out to the cc1.exe
> compiler, whereas g++ assumes programs are C++ by default, and so calls
> out
> to cc1plus.exe.  Oh, and g++ also adds a few directories to the default
> includes search path, and adds -lstdc++ to the linker line.
> 
>   This is more-or-less the same thing that happens when you use the -x
> language option: "gcc.exe -xc++ <files, options>" amounts to almost the
> same
> thing as "g++.exe <files, options>", and similarly "g++.exe -xc <files,
> options>" is almost the same as "gcc.exe <files, options>".
> 
I'd like to point out here that if your compiling c++ files, use g++.  A
common problem is people who are used to being able to use gcc and just add
-lstdc++ to the link, which worked successfully back with gcc2.  It doesn't
always work with gcc3 - hence just use g++, it is simpler and you don't have
to worry about the details, now - or in the future.

Its also worth noting that gcc doesn't assume files are c by default, gcc
makes a guess based on the file extension.  But again, the guess mode isn't
always the same as using the -x option. (although it probably should be the
same, some of the internals don't actually understand the -x options and use
file extension guess work exclusively)

Gareth

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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