gcc and g++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mahiapkum
    New Member
    • Mar 2007
    • 35

    gcc and g++

    What is the difference between g++ and gcc which are used for compiling c/c++ programs.I have an application which uses gcc for compilation and compiles sucessfully.But instead when i use g++ it gives me a error.
  • seforo
    New Member
    • Nov 2006
    • 60

    #2
    Normally g++ is used for compiling c++ program files (.cpp, .cxx, .c++) while gcc is used for c program files (.c)

    Comment

    • Benny the Guard
      New Member
      • Jun 2007
      • 92

      #3
      As an addendum g++ can compile C code but gcc cannot compile c++. Generally I suggest using g++ for everything as its a little more strict in checking the code and will identify potential problems.

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        If you use g++, I recommend also using the -pedantic switch to shut off non-ANS C++ features.

        Comment

        Working...