From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27843 invoked by alias); 10 Sep 2009 06:43:00 -0000 Received: (qmail 27797 invoked by uid 22791); 10 Sep 2009 06:42:59 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Sep 2009 06:42:54 +0000 Received: from spaceape23.eur.corp.google.com (spaceape23.eur.corp.google.com [172.28.16.75]) by smtp-out.google.com with ESMTP id n8A6gpZo020824 for ; Thu, 10 Sep 2009 07:42:51 +0100 Received: from yxe5 (yxe5.prod.google.com [10.190.2.5]) by spaceape23.eur.corp.google.com with ESMTP id n8A6gm8s010032 for ; Wed, 9 Sep 2009 23:42:49 -0700 Received: by yxe5 with SMTP id 5so8304750yxe.33 for ; Wed, 09 Sep 2009 23:42:48 -0700 (PDT) Received: by 10.90.188.17 with SMTP id l17mr702760agf.30.1252564968228; Wed, 09 Sep 2009 23:42:48 -0700 (PDT) Received: from localhost.localdomain.google.com (adsl-71-133-8-30.dsl.pltn13.pacbell.net [71.133.8.30]) by mx.google.com with ESMTPS id 4sm1518068agc.16.2009.09.09.23.42.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 09 Sep 2009 23:42:47 -0700 (PDT) To: mohsen@pahlevanzadeh.org Cc: gcc@gcc.gnu.org Subject: Re: gcc & C++ instead of g++ References: <1252561795.6184.10.camel@debian> From: Ian Lance Taylor Date: Thu, 10 Sep 2009 06:43:00 -0000 In-Reply-To: <1252561795.6184.10.camel@debian> (Mohsen Pahlevanzadeh's message of "Thu\, 10 Sep 2009 10\:19\:55 +0430") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-09/txt/msg00190.txt.bz2 Mohsen Pahlevanzadeh writes: > How do i write C++ with gcc instead of g++? The question is not appropriate for the mailing list gcc@gcc.gnu.org. It is appropriate for gcc-help@gcc.gnu.org. Please take any followups to gcc-help. Thanks. There is no particular reason to use gcc instead of g++. If you really want to do so, there are two easy ways: 1) name your files with an extension of .cc rather than .c; 2) use the -x c++ option. Note that if you link with gcc, you will need to explicitly use -lstdc++. Ian