How to compile/link Boost with clang++/libc++?

大城市里の小女人 提交于 2019-11-26 18:26:57
Howard Hinnant

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.

Jonas Klemming

Another option is to use Homebrew:

brew install boost --c++11

To get information on all options use:

brew info boost
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!