delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/09/21/22:25:41

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
Subject: Re: gcc does not know about "new" and "delete"
References: <46F40C47 DOT 3040005 AT research DOT telcordia DOT com> <46F4741F DOT 80108 AT pacific DOT net DOT sg>
From: Markus E L <ls-cygwin-2006 AT m-e-leypold DOT de>
Date: Sat, 22 Sep 2007 04:29:53 +0200
In-Reply-To: <46F4741F.80108@pacific.net.sg> (Erich Dollansky's message of "Sat, 22 Sep 2007 09:47:11 +0800")
Message-ID: <w3fy17l9em.fsf@hod.lan.m-e-leypold.de>
User-Agent: Some cool user agent (SCUG)
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

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.

I imagine the use of that is being able to compile with gcc to object
code reagrdless of the language involved, then linking within a
special runtime model, even if object files from multiple languages
are being linked together.

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

- Raw text -


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