g++

Oct 18, 2009 at 6:57am
I've a question about something I think is not related to C++. Can someone tell me what g++ is?
Oct 18, 2009 at 7:06am
Oct 20, 2009 at 4:18pm
closed account (S6k9GNh0)
That and G++ is VERY heavily related to C++.
Oct 20, 2009 at 8:31pm
G++ is a compiler; AFAIK it relies on the existance of GCC; but it does something else with the source. It's a very good compiler... but I generally just use GCC's -lStdc++ flag for C++. That way I can use the same compiler for both.
Oct 21, 2009 at 3:16am
That's not how the GCC (GNU Compiler Collection) is designed.

There are two general parts to the compiler: the front end, which understands your particular language and transforms it into an internal parse tree, and the back end which converts that parse tree into actual machine code.

Hence, using gcc causes the GCC to use C as the front end.
Using g++ causes the GCC to use C++ as the front end.

The same back end is used either way.

Why not just type "g++" instead of all that extra typing to do it the round-about way?
Oct 21, 2009 at 5:11am
Capitalization is important, people.
GCC: GNU Compiler Collection
gcc: GNU C Compiler
G++: No such thing
g++: GNU C++ compiler

GCC can refer to any or all of the compilers in the suite, so saying "I compiled it with GCC" would mean "it" was compiled with whatever compiler is applicable to the language (assuming only one language was used). gcc, however, refers specifically to the C compiler.

Now I wonder. chrisname: what exactly were you thinking?
Oct 21, 2009 at 1:34pm
I most probably... wasn't, to be perfectly honest.
Topic archived. No new replies allowed.