X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
Subject: Re: gcc does not know about "new" and "delete"
References: <46F40C47.3040005@research.telcordia.com> 	<46F4741F.80108@pacific.net.sg> 	<w3fy17l9em.fsf@hod.lan.m-e-leypold.de> 	<20070922035357.GA25395@ednor.casa.cgf.cx>
From: Markus E L <ls-cygwin-2006@m-e-leypold.de>
Date: Sat, 22 Sep 2007 12:47:36 +0200
In-Reply-To: <20070922035357.GA25395@ednor.casa.cgf.cx> (Christopher  Faylor's message of "Fri, 21 Sep 2007 23:53:57 -0400")
Message-ID: <crfy17t1rr.fsf@hod.lan.m-e-leypold.de>
User-Agent: Some cool user agent (SCUG)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com


Christopher Faylor wrote:

> On Sat, Sep 22, 2007 at 04:29:53AM +0200, Markus E L wrote:
>>Erich Dollansky wrote:
>>
>>> Hi,
>>>
>>> Framk gave you the answer.
>>
>>Was the right answer ...
>>
>>> gcc is a plain c compiler.
>>
>>... but this is wrong. Gcc determines from the file suffic which language
>>applies
>>
>>   .cpp -> c++
>>   .c   -> C
>>
>>and so on.
>>
>>Calling it as g++ vs. calling it as gcc though determines which
>>runtimes are linked automatically (and partly which include paths are
>>set).
>>
>>  gcc -o x x.cpp -lstdc++
>>
>>works perfectly with the OPs program.

> That may be but it isn't guaranteed to work perfectly with every single
> C++ program out there.  

Exactly. That's why I said "with the OP's program", the implication
being that with other programs it might be necessary to add other
libraries (or include paths), too.

I've just been opposing the notion implied in "gcc is a plain c
compiler" that the compiler frontend determines the language to be
compiled. With gcc it determines the run time environment to be linked
and (perhaps) visible interfaces (as usually configured manually by
-I, but I'd like to note that's a theoretical possibility and
empirically doesn't seem to happen at the moment).

> There are potentially other libraries which might be required for
> C++.  You really should use g++ to link C++ programs.

Right. I never said differently.

-- Markus

--
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/

