public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Sampath Kumar Herga" <sherga@airvananet.com>
To: <random@bubblescope.net>
Cc: <gcc-help@gcc.gnu.org>
Subject: RE: Gcc/g++
Date: Thu, 14 Jul 2005 08:59:00 -0000	[thread overview]
Message-ID: <653F3CF58193744C9DE59C217C072B5814E061@nilgiri.india.wirelessworld.airvananet.com> (raw)

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. 

Sampath. 

-----Original Message-----
From: random@bubblescope.net [mailto:random@bubblescope.net] 
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 
>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

             reply	other threads:[~2005-07-14  8:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-14  8:59 Sampath Kumar Herga [this message]
2005-07-14 13:30 ` Gcc/g++ Ishwar Rattan
  -- strict thread matches above, loose matches on Subject: below --
2005-07-13 16:26 Gcc/g++ Eljay Love-Jensen
2005-07-13 15:48 Gcc/g++ Sampath Kumar Herga
2005-07-13 15:53 ` Gcc/g++ random

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=653F3CF58193744C9DE59C217C072B5814E061@nilgiri.india.wirelessworld.airvananet.com \
    --to=sherga@airvananet.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=random@bubblescope.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).