What is the difference between g++ and gcc?

Brian R. Bondy

What is the difference between g++ and gcc? Which one of them should be used for general c++ development?

Mike F

gcc and g++ are compiler-drivers of the GNU Compiler Collection (which was once upon a time just the GNU C Compiler).

Even though they automatically determine which backends (cc1 cc1plus ...) to call depending on the file-type, unless overridden with -x language, they have some differences.

The probably most important difference in their defaults is which libraries they link against automatically.

According to GCC's online documentation link options and how g++ is invoked, g++ is equivalent to gcc -xc++ -lstdc++ -shared-libgcc (the 1st is a compiler option, the 2nd two are linker options). This can be checked by running both with the -v option (it displays the backend toolchain commands being run).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

What’s the difference between 'gcc -g' and 'gcc -g3'?

From Dev

What is the difference between clang (and LLVM) and gcc / g++?

From Dev

What is the difference between clang (and LLVM) and gcc / g++?

From Java

What is the difference between gcc/g++ and cc1/cc1plus?

From Dev

In Regex, what is the difference between (?!^)\G and \G(?!^)?

From Dev

In Regex, what is the difference between (?!^)\G and \G(?!^)?

From Dev

What is the difference between -g and -G options in useradd

From Dev

What is the difference between the __sync and __atomic intrinsics of gcc

From Dev

What's the Difference between linking by GCC and LD?

From Dev

What is the difference between the __sync and __atomic intrinsics of gcc

From Dev

what is the difference between which gcc and dpkg -l | grep gcc

From Dev

What is the difference between :g and :%s commands in vim

From Dev

What is the difference between "shutdown /r" and "shutdown /g"?

From Dev

perl-rename - What is the difference between /g' and /'?

From Dev

What is the difference between 2.4G and 5G wireless?

From Dev

What is the difference between calling "id -G" and "id -G -r"?

From Dev

What is the difference between the different GCC on Cygwin, and which one to install?

From Dev

Difference between clang and gcc

From Dev

What's the difference between functions starting with G_ and GTK_?

From Dev

Difference between Cross GCC and Linux GCC toolchain

From Dev

What's the difference between "as?", "as!", and "as"?

From Dev

What is the difference in operation between . and ^ and ^(.*)$?

From Dev

What is the difference between .// and //* in XPath?

From Dev

What is the difference between = and => for a variable?

From Dev

What is difference between "?" and "!" in Swift?

From Java

What is the difference between `.` and `#` in the JavaDoc?

From Dev

CoffeeScript, What is the difference between => and ->

From Java

What is the difference between * and *|* in CSS?

From Dev

What is the difference between $* and $@

Related Related

  1. 1

    What’s the difference between 'gcc -g' and 'gcc -g3'?

  2. 2

    What is the difference between clang (and LLVM) and gcc / g++?

  3. 3

    What is the difference between clang (and LLVM) and gcc / g++?

  4. 4

    What is the difference between gcc/g++ and cc1/cc1plus?

  5. 5

    In Regex, what is the difference between (?!^)\G and \G(?!^)?

  6. 6

    In Regex, what is the difference between (?!^)\G and \G(?!^)?

  7. 7

    What is the difference between -g and -G options in useradd

  8. 8

    What is the difference between the __sync and __atomic intrinsics of gcc

  9. 9

    What's the Difference between linking by GCC and LD?

  10. 10

    What is the difference between the __sync and __atomic intrinsics of gcc

  11. 11

    what is the difference between which gcc and dpkg -l | grep gcc

  12. 12

    What is the difference between :g and :%s commands in vim

  13. 13

    What is the difference between "shutdown /r" and "shutdown /g"?

  14. 14

    perl-rename - What is the difference between /g' and /'?

  15. 15

    What is the difference between 2.4G and 5G wireless?

  16. 16

    What is the difference between calling "id -G" and "id -G -r"?

  17. 17

    What is the difference between the different GCC on Cygwin, and which one to install?

  18. 18

    Difference between clang and gcc

  19. 19

    What's the difference between functions starting with G_ and GTK_?

  20. 20

    Difference between Cross GCC and Linux GCC toolchain

  21. 21

    What's the difference between "as?", "as!", and "as"?

  22. 22

    What is the difference in operation between . and ^ and ^(.*)$?

  23. 23

    What is the difference between .// and //* in XPath?

  24. 24

    What is the difference between = and => for a variable?

  25. 25

    What is difference between "?" and "!" in Swift?

  26. 26

    What is the difference between `.` and `#` in the JavaDoc?

  27. 27

    CoffeeScript, What is the difference between => and ->

  28. 28

    What is the difference between * and *|* in CSS?

  29. 29

    What is the difference between $* and $@

HotTag

Archive