• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

G++, GCC, and CC... differences?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

gt24

Member
Joined
Aug 10, 2003
Location
Ohio
On a Linux machine, I was compiling programs and mistakenly tried to use CC. It was a C program so I didn't think it would be a huge deal until the compiler didn't understand the "new" operator. So, I quickly wrote a C++ program (thinking it is a stupid C program issue) and I sent that through GCC... and got the same problem with the new operator. Finally, I sent a C program (and C++ program) though G++ and I had no problems...

(frustrating evening...)

So, what is the differences between GCC, CC, and G++? When should you use each variation? Can you tell me any more about them?
 
...So, what is the differences between GCC, CC, and G++? When should you use each variation? Can you tell me any more about them?
GCC is the GNU Compiler Collection; gcc itself (as a command) I believe would call the C compiler.
G++ is a frontend to C++ for GCC, allowing you to compile C++ programs.
On a Linux system, cc is normally just a symlink to gcc.

So use gcc for C programs and g++ for C++ programs.
This might explain it a bit better. Hope that helps.
 
Back