What is the difference between g++ and gcc?
(g ++和gcc有什么区别?)
Which ones should be used for general c++ development?(哪些应该用于一般的c ++开发?)
ask by Brian R. Bondy translate from soWhat is the difference between g++ and gcc?
(g ++和gcc有什么区别?)
Which ones should be used for general c++ development?(哪些应该用于一般的c ++开发?)
ask by Brian R. Bondy translate from so gcc
and g++
are compiler-drivers of the GNU Compiler Collection (which was once upon a time just the GNU C Compiler ).
(gcc
和g++
是GNU Compiler Collection的编译器驱动程序(曾经只是GNU C编译器 )。)
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.
(即使它们根据文件类型自动确定调用哪些后端( cc1
cc1plus
...),除非用-x language
覆盖,否则它们会有一些差异。)
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).
(根据GCC的在线文档链接选项以及如何调用 g++
, g++
等同于gcc -xc++ -lstdc++ -shared-libgcc
(第一个是编译器选项,第二个是链接器选项)。)
-v
option (it displays the backend toolchain commands being run). (这可以通过使用-v
选项运行来检查(它显示正在运行的后端工具链命令)。)