ubuntu 下 clang最新的安裝方法已經繫結命令
阿新 • • 發佈:2019-02-05
- 介紹
- 場景:折騰atom,遇到其中外掛
autocomplete-clang
無法正常工作. - 原因&分析:先下的clang 5.0結果要在終端下要這樣
clang-5.0
才可以呼叫,如果修改atom外掛配置,會報string錯誤,估計只能識別clang
命令.
- 解決辦法
- 先更新下軟體庫並安裝庫中的老版本(clang3.8)
sudo apt-get update
sudo apt-get install clang
- 在安裝新版本的clang(5.0)
sudo apt-get update
sudo apt-get install clang-5.0
- 接下來按下文修改系統預設行為的命令按提示執行即可
Making latest version available as clang
This version is installed side-by-side with the default clang 3.8. To run it, you have to explicitly say clang-5.0. clang will either refer to 3.8 (if you’ve installed it) or nothing at all.You can reconfigure the system so that clang refers to clang 5:
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.8 100 sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 1000 sudo update-alternatives --install /usr/bin/clang++ clang /usr/bin/clang-3.8 100 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.8
100 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 1000 sudo update-alternatives --config clang sudo update-alternatives --config clang++This might help if you have scripts that hard-code name of the compiler and don’t allow over-writing it.