The answer to this question Why can't clang with libc++ in c++0x mode link this boost::program_options example? states "You need to rebuild boost using clang++ -stdlib=libc++."
I'm using MacOS Lion with clang v3.0. How do I build Boost v1.48.0 using clang and link it with libc++?
Update: I've created a user-config.jam file with the following:
using clang-darwin
...which will build Boost with clang instead of gcc. How do I link with libc++ instead of libstdc++?
Most Boost libraries are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking. The only Boost libraries that must be built separately are: Boost.
Most implementations of libstdc++ depend on libc, so they require it. The C++ standard includes most of the C standard library. So it's kind of a dependency and technically it's part of the C++ standard library.
Here's how to check if a library is installed: 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.
I didn't know how to do this either. But after poking around in here, the getting started, and trial and error:
$ ./bootstrap --with-toolset=clang $ ./b2 clean $ ./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++"
You'll get lots of warnings. And the signals library will fail to build due to LWG 2059. But otherwise I think it works.
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