From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23385 invoked by alias); 14 Jul 2005 08:59:49 -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 23368 invoked by uid 22791); 14 Jul 2005 08:59:43 -0000 Received: from mail1.airvananet.com (HELO mail.wirelessworld.airvananet.com) (12.6.244.28) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 14 Jul 2005 08:59:43 +0000 Received: from nilgiri.india.wirelessworld.airvananet.com ([192.168.51.3]) by mail.wirelessworld.airvananet.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 14 Jul 2005 04:59:41 -0400 Content-class: urn:content-classes:message Subject: RE: Gcc/g++ MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Thu, 14 Jul 2005 08:59:00 -0000 Message-ID: <653F3CF58193744C9DE59C217C072B5814E061@nilgiri.india.wirelessworld.airvananet.com> From: "Sampath Kumar Herga" To: Cc: X-SW-Source: 2005-07/txt/msg00140.txt.bz2 Chris, Thanks for the response. Any specific reason to not use gcc to compile g++ files? One thing I found was that when creating the final binary, g++ needs to be used. Else it does not link in the correct libraries. But for just generating .o from a .cpp file, does the use of gcc/g++ make any difference.=20 Sampath.=20 -----Original Message----- From: random@bubblescope.net [mailto:random@bubblescope.net]=20 Sent: Wednesday, July 13, 2005 9:21 PM To: Sampath Kumar Herga Cc: gcc-help@gcc.gnu.org Subject: Re: Gcc/g++ Sampath Kumar Herga wrote: > Hi, > >I am new to this group and had a very basic question. What is the=20 >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=20 >use? > >=20=20 > 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=20 >question. > >=20=20 > I'm fairly sure it is :) Chris