“g++"和“c++"编译器 [英] "g++" and "c++" compiler

查看:63
本文介绍了“g++"和“c++"编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的 Ubuntu 上发现,有两种不同的 C++ 编译器:/usr/bin/g++/usr/bin/c++.我对后者不熟悉,但 man c++ 只是跳转到 gcc 的手册页.我想知道它们作为 C++ 编译器有什么区别?

I just found on my Ubuntu, there are two different C++ compilers: /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?

推荐答案

这是典型的 Ubuntu 符号链接混乱.

This is typical Ubuntu symlink mayhem.

如果你ls -l/usr/bin/c++,你会发现它实际上是一个符号链接.到:

If you ls -l /usr/bin/c++, you will see it is actually a symbolic link. to:

/etc/alternatives/c++

这又是一个符号链接:

/usr/bin/g++

所以,在 Ubuntu 系统上,c++ g++.链接间接背后的原因是有多个包可以提供 c++ 编译器(例如不同版本的 g++).你会在 Ubuntu 上看到很多.例如,qmake 是指向/etc/alternatives 中文件的链接,它(在我的系统上)是指向/usr/bin/qmake-qt3 的链接.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆