From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11600 invoked by alias); 13 Jul 2005 16:26:52 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 11561 invoked by uid 22791); 13 Jul 2005 16:26:43 -0000 Received: from exprod6og1.obsmtp.com (HELO psmtp.com) (64.18.1.121) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Wed, 13 Jul 2005 16:26:43 +0000 Received: from source ([192.150.20.142]) by exprod6ob1.obsmtp.com ([64.18.5.12]) with SMTP; Wed, 13 Jul 2005 09:26:40 PDT Received: from inner-relay-3.eur.adobe.com (inner-relay-3b [10.128.4.236]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id j6DGWlTK009506 for ; Wed, 13 Jul 2005 09:32:48 -0700 (PDT) Received: from iplan-mn (iplan-mn.corp.adobe.com [10.32.16.20]) by inner-relay-3.eur.adobe.com (8.12.10/8.12.9) with ESMTP id j6DGQaj0008273 for ; Wed, 13 Jul 2005 09:26:38 -0700 (PDT) Received: from iplan-mn (localhost [127.0.0.1]) by iplan-mn.corp.adobe.com (iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)) with ESMTP id <0IJK00CPGR0BJP@iplan-mn.corp.adobe.com> for gcc-help@gcc.gnu.org; Wed, 13 Jul 2005 11:26:35 -0500 (CDT) Received: from mn-eljay-a51m.adobe.com (mn-dhcp-17-28.corp.adobe.com [10.32.17.28]) by iplan-mn.corp.adobe.com (iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)) with ESMTP id <0IJK00CF1R0BJL@iplan-mn.corp.adobe.com> for gcc-help@gcc.gnu.org; Wed, 13 Jul 2005 11:26:35 -0500 (CDT) Date: Wed, 13 Jul 2005 16:26:00 -0000 From: Eljay Love-Jensen Subject: Re: Gcc/g++ To: Sampath Kumar Herga , gcc-help@gcc.gnu.org Message-id: <6.2.1.2.2.20050713112311.022519b8@iplan-mn.corp.adobe.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-SW-Source: 2005-07/txt/msg00131.txt.bz2 Hi Sampath, >What is the difference between gcc and g++ when compiling c++ files. gcc is the tool-chain driver for compiling C files. g++ is the tool-chain driver for compiling C++ files. You can use the '-v' flag to enable verbose mode, which will give you more details what's going on behind the scenes. The details do differ from OS to OS, and from GCC version to GCC version. So I can't be more specific than that given the information you've provided. >Also if we have a mix of c and c++ files in a project, which is the better compiler to use? In general, I suggest making your C files C++ files with the minimal amount of work possible. That "minimal amount of work" often is "no work whatsoever" or "merely renaming Foo.c to Foo.cpp", since C++ is a mostly compatible superset of C. That's not always easily possible, though. Ergo... If you prefer to keep your C files as C files (i.e., C ABI for the object code), then you'll have to do a bit of work to make the C header files properly digestable in C++ land. Annotating the globally linked identifiers with extern "C". Making sure you never throw an exception over the C barrier. Yada yada yada. HTH, --Eljay