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++
tells me that
There is only one alternative in link group c++ (providing /usr/bin/c++): /usr/bin/g++ Nothing to configure.
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
My OS version is Ubuntu 14.04.1 LTS.
What do I have to do to make update-alternatives
include clang++3.6?
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.
Open a terminal window. Enter the command (clang — version) to confirm if the Clang Compilers had already been installed.
Use the default install location: C:\Program Files (x86)\LLVM and complete the installation. clang++.exe should be located in C:\Program Files (x86)\LLVM\bin , but should NOT be in your system path.
To open up a terminal window on Ubuntu, press Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Once the terminal window is open and ready to use, enter the apt install command and install the “clang-12” package, along with the –install-suggests command-line switch, which grabs all suggested packages.
These work for me:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With