I installed clang
from scratch following the instructions here. Afterwards, I installed libc++
using libsupc++
according to the instructions here.
Now, whenever I compile & link a program with clang
and libc++
, I need to issue a command like that:
clang++ -stdlib=libc++ -Wl,-rpath,/path/to/libcxx/lib <...>
Is there a way to configure/compile clang in a way that it uses libc++
by default, without me having to specify the library and/or the path on the command line each time? Putting it into LD_LIBRARY_PATH
is not a preferred option either, neither is using a custom wrapper script.
One can also use clang with Microsoft Visual Studio C and C++ libraries.
Type ldconfig -p | grep libc++ into the terminal. It does not matter what system you are using. If libc++ is not installed, the terminal will not say anything. If it is installed, it will display the available versions.
libc++abi is a new implementation of low level support for a standard C++ library. All of the code in libc++abi is dual licensed under the MIT license and the UIUC License (a BSD-like license).
Clang supports use of either LLVM's libc++ or GCC's libstdc++ implementation of the C++ standard library.
Clang's CMake build system learned the CLANG_DEFAULT_CXX_STDLIB
to set the default C++ standard library.
However, I don't know how practicable this solution is for you, because you have to use a top of tree build until next clang/llvm release.
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