Unable to build simple C++ app using clang++ on ubuntu
Asked Answered
B

2

20

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.

Boysenberry answered 19/3, 2018 at 4:47 Comment(3)
Are you using linux machine ? then use packages.ubuntu.com/trusty/libdevel/libc++abi-dev link to download lib.Slier
Possible duplicate of What is the difference between libc++ and libc++abi library in LLVM?Slier
Thanks @syam.k it worked.Boysenberry
B
29

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.

Boysenberry answered 19/3, 2018 at 5:24 Comment(0)
A
1

Thanks @Ravikumar-Tulugu and @Martin-Valgur. In my case (Fedora) I installed the equivalent that is in package lbcxxabi.

Ayr answered 30/4, 2023 at 15:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.