“g ++”和“c ++”编译器 [英] "g++" and "c++" compiler
问题描述
我刚在Ubuntu上发现,有两个不同的C ++编译器:/ usr / bin / g ++和/ usr / bin / c ++。我不熟悉后者,但是人类c ++只是跳转到gcc的联机帮助页。我不知道他们与C ++编译器有什么区别?
感谢和问候!
如果你 ls -l / usr / bin / c ++
这是典型的Ubuntu符号链接混乱。
< ,你会看到它实际上是一个符号链接。到:
/ etc / alternatives / c ++
这又是一个符号链接:
/ usr / bin / g ++
因此,在Ubuntu系统上,c ++ 是 g ++。链接间接的背后的原因是有多个包可以提供一个c ++编译器(如不同版本的g ++)。你会看到这很多在Ubuntu上。例如,qmake是/ etc / alternatives中的文件的链接,这是(在我的系统上)回到/ usr / bin / qmake-qt3的链接。
I just found on my Ubuntu, there are two different C++ compiler: /usr/bin/g++ and /usr/bin/c++. I am not familiar with the latter, but man c++ just jumps to the manpage of gcc. I wonder what is their difference as C++ compilers?
Thanks and regards!
This is typical Ubuntu symlink mayhem.
If you ls -l /usr/bin/c++
, you will see it is actually a symbolic link. to:
/etc/alternatives/c++
Which in turn, is also a symbolic link to:
/usr/bin/g++
So, on Ubuntu systems, c++ is g++. The reasoning behind the link indirection is that there are multiple packages that could provide a c++ compiler (such as different versions of g++). You'll see this a lot on Ubuntu. For example, qmake is a link to a file in /etc/alternatives, which is (on my system) a link back to /usr/bin/qmake-qt3.
这篇关于“g ++”和“c ++”编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!