I am unable to build a simple hello world application using clang-6.0 on bionic beaver, the build command fails with below error.
clang++-6.0 -std=c++17 -stdlib=libc++ hello.cc -o hello
/usr/bin/ld: cannot find -lc++abi
clang: error: linker command failed with exit code 1 (use -v to see invocation)
what is this c++abi library and where can i find it ?? Please advise.
There are circumstances that you don’t have an admin account on a machine and you need to install the latest Clang. Here, I explain how you can compile Clang 13 from the source on Ubuntu. I use Ubuntu 20.04 installed on Windows 10 via Windows Subsystem for Linux (WSL).
The Clang compiler is an alternative to GCC. It can be used to compile code into runnable binary programs. If you’re a developer on Ubuntu, you’ve likely dealt with a compiler like this before. While most Ubuntu developers stick with GCC, they also make it possible to get going with the Clang compiler.
So, you just enable the universe repository and then install clang - either from the software store or from the command line using Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed.
clang-14 is not available for your release ... but available as of Ubuntu 22.04 So, upgrading to 22.04 is what you might want to consider. You can download clang 14 for with the instructions on the llvm page here:
sudo apt-get install libc++abi-dev command will fix the problem
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