如何编译铿锵++ /的libc ++ /链接升压? [英] How to compile/link Boost with clang++/libc++?

查看:117
本文介绍了如何编译铿锵++ /的libc ++ /链接升压?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在回答这个问题为什么不能用的libc ++中的C ++ 0x模式这个链接的boost :: program_options例如铛<? / A>指出:你需要用铿锵++ -stdlib = ++的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆