Search code examples
clang++

Unable to build simple C++ app using clang++ on ubuntu


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.


Solution

  • sudo apt-get install libc++abi-dev command will fix the problem.

    If you are using a non-default version of Clang, you will have to install a more specific version, e.g. libc++abi-12-dev.