From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23953 invoked by alias); 13 Jul 2005 15:53:40 -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 23851 invoked by uid 22791); 13 Jul 2005 15:53:31 -0000 Received: from mailgw.cs.york.ac.uk (HELO mailgw.cs.york.ac.uk) (144.32.40.3) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 13 Jul 2005 15:53:31 +0000 Received: from minster.cs.york.ac.uk ([144.32.40.2]) by mailgw.cs.york.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1DsjVz-00062F-Mg; Wed, 13 Jul 2005 16:51:15 +0100 Received: from bushfire.cs.york.ac.uk ([144.32.40.24] helo=[192.168.112.229]) by minster.cs.york.ac.uk with esmtp (Exim 4.44) id 1DsjVz-0001pf-R8; Wed, 13 Jul 2005 16:51:15 +0100 Message-ID: <42D5386E.2020005@bubblescope.net> Date: Wed, 13 Jul 2005 15:53:00 -0000 From: random@bubblescope.net User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) MIME-Version: 1.0 To: Sampath Kumar Herga CC: gcc-help@gcc.gnu.org Subject: Re: Gcc/g++ References: <653F3CF58193744C9DE59C217C072B5814DFE2@nilgiri.india.wirelessworld.airvananet.com> In-Reply-To: <653F3CF58193744C9DE59C217C072B5814DFE2@nilgiri.india.wirelessworld.airvananet.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2005-07/txt/msg00130.txt.bz2 Sampath Kumar Herga wrote: > Hi, > >I am new to this group and had a very basic question. What is the >difference between gcc and g++ when compiling c++ files. > Short version: Don't use gcc to compile c++ files unless you know what you are doing :) >Also if we have >a mix of c and c++ files in a project, which is the better compiler to >use? > > > If you C files are also valid C++ (which there is a good chance there will be, espically if they are well written), it would be easiest to compile them all as C++. If you can't / don't want to do this, you'll have to use the "extern C" notation to mark any functions called from, or defined in, a C file. >Please let me know if this is not the correct mailing-list for this >question. > > > I'm fairly sure it is :) Chris