public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: GCC  vs G++
@ 2007-06-12  4:31 Timothy C Prince
  0 siblings, 0 replies; 6+ messages in thread
From: Timothy C Prince @ 2007-06-12  4:31 UTC (permalink / raw)
  To: Dhiraj.Nilange; +Cc: gcc-help



-----Original Message-----
From: <Dhiraj.Nilange@iflexsolutions.com>
To: <gcc-help@gcc.gnu.org>
Date: Mon, 11 Jun 2007 14:43:16 +0530
Subject: GCC  vs G++

Hi,

I am using Linux. I am not still sure about the difference between g++
and gcc. Is g++ just a wrapper for gcc? I am not sure which one I should
use
for compiling my C++ codes?

____________________________----
gcc is the C front end for GNU compiler.
g++ is the C++ front end.  To a limited extent, each could invoke the other, according to source file suffix naming.  You need both to compile C++, but you use g++ as the command.


Tim Prince

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: GCC vs G++
  2007-06-13  3:12   ` NightStrike
  2007-06-13  3:37     ` David Daney
@ 2007-06-13 21:35     ` me22
  1 sibling, 0 replies; 6+ messages in thread
From: me22 @ 2007-06-13 21:35 UTC (permalink / raw)
  To: NightStrike
  Cc: Ian Lance Taylor, Dhiraj.Nilange, gcc-help, Gregg D. Gramatges

On 12/06/07, NightStrike <nightstrike@gmail.com> wrote:
> So the way I read this is that I *could* use gcc for compiling .cpp
> files that use c++ libraries, correct?  It never seems to work, even
> for a simple "Hello, world."
>
On my platform,
gcc some_c++_file.cpp -lstdc++
seems to behave the same as
g++ some_c++_file.cpp

I don't know why one would want to use the prior, however.

~ Scott

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: GCC vs G++
  2007-06-13  3:12   ` NightStrike
@ 2007-06-13  3:37     ` David Daney
  2007-06-13 21:35     ` me22
  1 sibling, 0 replies; 6+ messages in thread
From: David Daney @ 2007-06-13  3:37 UTC (permalink / raw)
  To: NightStrike
  Cc: Ian Lance Taylor, Dhiraj.Nilange, gcc-help, Gregg D. Gramatges

NightStrike wrote:
> On 11 Jun 2007 10:08:11 -0700, Ian Lance Taylor <iant@google.com> wrote:
>> <Dhiraj.Nilange@iflexsolutions.com> writes:
>>
>> > I am using Linux. I am not still sure about the difference between g++
>> > and gcc. Is g++ just a wrapper for gcc? I am not sure which one I 
>> should
>> > use
>> > for compiling my C++ codes?
>>
>> g++ is very similar to gcc.  The main difference is that g++ assumes
>> that it is compiling C++ (gcc will compile C++ for files ending in
>> ".cc", ".C", etc.), and g++ always links against the standard C++
>> library.
>>
>> When compiling C++ you should use g++ in all normal cases.
>
> So the way I read this is that I *could* use gcc for compiling .cpp
> files that use c++ libraries, correct?
Yes.
> It never seems to work, even
> for a simple "Hello, world."
It works for me everyday, but I know all the special things I have to do 
on the platform I am using.

The reason to use g++ is that it works with no special non-portable magic.

David Daney

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: GCC vs G++
  2007-06-12  4:20 ` Ian Lance Taylor
@ 2007-06-13  3:12   ` NightStrike
  2007-06-13  3:37     ` David Daney
  2007-06-13 21:35     ` me22
  0 siblings, 2 replies; 6+ messages in thread
From: NightStrike @ 2007-06-13  3:12 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Dhiraj.Nilange, gcc-help, Gregg D. Gramatges

On 11 Jun 2007 10:08:11 -0700, Ian Lance Taylor <iant@google.com> wrote:
> <Dhiraj.Nilange@iflexsolutions.com> writes:
>
> > I am using Linux. I am not still sure about the difference between g++
> > and gcc. Is g++ just a wrapper for gcc? I am not sure which one I should
> > use
> > for compiling my C++ codes?
>
> g++ is very similar to gcc.  The main difference is that g++ assumes
> that it is compiling C++ (gcc will compile C++ for files ending in
> ".cc", ".C", etc.), and g++ always links against the standard C++
> library.
>
> When compiling C++ you should use g++ in all normal cases.

So the way I read this is that I *could* use gcc for compiling .cpp
files that use c++ libraries, correct?  It never seems to work, even
for a simple "Hello, world."

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: GCC  vs G++
  2007-06-11 11:09 Dhiraj.Nilange
@ 2007-06-12  4:20 ` Ian Lance Taylor
  2007-06-13  3:12   ` NightStrike
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Lance Taylor @ 2007-06-12  4:20 UTC (permalink / raw)
  To: Dhiraj.Nilange; +Cc: gcc-help

<Dhiraj.Nilange@iflexsolutions.com> writes:

> I am using Linux. I am not still sure about the difference between g++
> and gcc. Is g++ just a wrapper for gcc? I am not sure which one I should
> use
> for compiling my C++ codes?

g++ is very similar to gcc.  The main difference is that g++ assumes
that it is compiling C++ (gcc will compile C++ for files ending in
".cc", ".C", etc.), and g++ always links against the standard C++
library.

When compiling C++ you should use g++ in all normal cases.

Ian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* GCC  vs G++
@ 2007-06-11 11:09 Dhiraj.Nilange
  2007-06-12  4:20 ` Ian Lance Taylor
  0 siblings, 1 reply; 6+ messages in thread
From: Dhiraj.Nilange @ 2007-06-11 11:09 UTC (permalink / raw)
  To: gcc-help

Hi,

I am using Linux. I am not still sure about the difference between g++
and gcc. Is g++ just a wrapper for gcc? I am not sure which one I should
use
for compiling my C++ codes?

Thanks
-Dhiraj

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-13 13:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-12  4:31 GCC vs G++ Timothy C Prince
  -- strict thread matches above, loose matches on Subject: below --
2007-06-11 11:09 Dhiraj.Nilange
2007-06-12  4:20 ` Ian Lance Taylor
2007-06-13  3:12   ` NightStrike
2007-06-13  3:37     ` David Daney
2007-06-13 21:35     ` me22

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).