LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is the difference between gcc and g++ (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-the-difference-between-gcc-and-g-746426/)

bskumar7080 08-10-2009 08:09 AM

What is the difference between gcc and g++
 
I want to know the difference between gcc and g++

Wim Sturkenboom 08-10-2009 08:18 AM

gcc is a C compiler and g++ a C++ compiler

From the man page
Code:

      C++ source files conventionally use one of the suffixes .C, .cc, .cpp,
      .CPP, .c++, .cp, or .cxx; C++ header files often use .hh or .H; and
      preprocessed C++ files use the suffix .ii.  GCC recognizes files with
      these names and compiles them as C++ programs even if you call the com‐
      piler the same way as for compiling C programs (usually with the name
      gcc).

      However, the use of gcc does not add the C++ library.  g++ is a program
      that calls GCC and treats .c, .h and .i files as C++ source files
      instead of C source files unless -x is used, and automatically speci‐
      fies linking against the C++ library.  This program is also useful when
      precompiling a C header file with a .h extension for use in C++ compi‐
      lations.  On many systems, g++ is also installed with the name c++.

      When you compile C++ programs, you may specify many of the same com‐
      mand-line options that you use for compiling programs in any language;
      or command-line options meaningful for C and related languages; or
      options that are meaningful only for C++ programs.


pixellany 08-10-2009 08:20 AM

Did you Google?

C and C++, maybe? Actually, I've seen two expansions of "gcc":
Gnu C Compiler
Gnu Compiler Collection


All times are GMT -5. The time now is 08:27 PM.