wfxr
9/15/2016 - 2:07 AM

boost-build.md

Linux

http://www.boost.org/build/doc/html/bbv2/overview/invocation.html

http://juniway.blogspot.com/2015/12/install-boost-1590-build-from-source.html

# Run the script which prepares Boost's build process
./bootstrap.sh --with-toolset=clang
./b2 -j8 toolset=clang variant=release threading=multi cxxflags="-std=c++14 -stdlib=libc++"
sudo ./b2 install
 
# Add the Boost libraries path to the default Ubuntu library search path
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/boost.conf'
 
# Update the default Ubuntu library search paths
sudo ldconfig

Windows

Build the x86 binaries

bjam --toolset=msvc --build-type=complete stage

Create the directory lib\x86

Move the contents of stage\lib to lib\win32 Remove the directories bin.v2 and stage

Build the x64 binaries

bjam --toolset=msvc address-model=64 --build-type=complete stage

Create the directory lib\x64

Move the contents of stage\lib to lib\x64 Remove the directories bin.v2 and stage

ISSUES

boost库在Windows下使用默认选项编译,在使用时会提示未知的Windows版本,假定为xp;

解决方案是配置编译参数b2 release define=BOOST_USE_WINAPI_VERSION=xxx,xxx为十六进制数,表示Windows的版本号。

完整的Windows版本号列表在这里:https://msdn.microsoft.com/en-us/library/6sehtctf.aspx