在Ubuntu上安装了clang ++ 3.6,无法选择 [英] Installed clang++3.6 on Ubuntu, can't select as alternative

查看:361
本文介绍了在Ubuntu上安装了clang ++ 3.6,无法选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Ubuntu计算机上安装了clang ++ 3.6,但是无法将其设置为默认的c ++编译器.

I just installed clang++3.6 on my Ubuntu machine, but can't set it as the default c++ compiler.

sudo update-alternatives --config c++ 

告诉我

There is only one alternative in link group c++ (providing /usr/bin/c++): /usr/bin/g++
Nothing to configure.

并且clang ++没有显示在

and clang++ doesn't show up in

sudo update-alternatives --query c++

两者之一(这是预料之中的).但是编译器肯定可以工作:

either (which was to be expected). But the compiler definitely works:

which clang++-3.6 
/usr/bin/clang++-3.6

我的操作系统版本是Ubuntu 14.04.1 LTS.

My OS version is Ubuntu 14.04.1 LTS.

要使update-alternatives包含clang ++ 3.6,我该怎么做?

What do I have to do to make update-alternatives include clang++3.6?

注意:我以前使用过clang3.4,但是将其删除了,因为它不支持我需要的所有c ++ 11功能.似乎仅安装clang ++软件包(我专门安装了clang ++ 3.6)时,仍然是安装的版本. update-alternatives DID适用于该版本.

Note: I previously used clang3.4, but removed it since it doesn't support all c++11 feature I require. It seems that this is still the version installed when simply installing the clang++ package (I specifically installed clang++3.6); update-alternatives DID work for that version.

推荐答案

这些对我有用:

sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-3.6 100
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-3.6 100

这篇关于在Ubuntu上安装了clang ++ 3.6,无法选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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