如何编译铿锵++ /的libc ++ /链接升压? [英] How to compile/link Boost with clang++/libc++?
问题描述
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++."
我使用MacOS的狮子铿锵V3.0。我如何使用铛建设加速v1.48.0和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++?
更新:我创建了一个的用户config.jam中的有以下文件:
Update: I've created a user-config.jam file with the following:
using clang-darwin
...这将打造铿锵而不是gcc提升。我怎样联系起来的libc ++来代替的libstdc ++?
...which will build Boost with clang instead of gcc. How do I link with libc++ instead of libstdc++?
推荐答案
我不知道如何可以做到这一点。但闲逛后的here,和反复试验:
I didn't know how to do this either. But after poking around here, and trial and error:
$ ./b2 clean
$ ./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++"
您会得到很多的警告。并且信号库将无法建立,由于 LWG 2059 。但是,否则我的认为的工作原理。
You'll get lots of warnings. And the signals library will fail to build due to LWG 2059. But otherwise I think it works.
这篇关于如何编译铿锵++ /的libc ++ /链接升压?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!