vs2015 配置boost

来源:互联网 发布:js获取ios系统版本 编辑:程序博客网 时间:2024/06/04 19:14

vs2015 配置boost


1、首先到boost官网去下载最新的版本的boost库:

http://www.boost.org/

http://www.boost.org/users/download/

2、解压文件,在命令提示符中打开到boost库的根目录下:

双击bootstrap.bat文件,生成bjam.exe,执行以下命令:

bjam --toolset=msvc --build-type=complete stage // 32位

b2.exe  --build-type=complete --stagedir=".\lib\vc12_x64" address-model=64  //64位

或者直接双击bjam.exe.

等待程序编译完成,大约要两个小时左右,会在boost根目录下生成bin.v2和stage两个文件夹,其中bin.v2下是生成的中间文件,大小在2.7G左右,可以直接删除。stage下才是生成的dll和lib文件。


3、打开vs:

视图->属性管理器->当前项目->Debug|Win32->Microsoft.Cpp.Win32.user双击

在弹出的属性对话框中:

通用属性->VC++目录:"包含目录": boost的根目录,例: D:\Visual Stdio 2013\lipeng\boost\boost_1_58_0

"库目录": stage下的链接库目录,例:D:\Visual Stdio 2013\lipeng\boost\boost_1_58_0\stage\lib

通用属性->链接器->常规:"附加库目录":同上面的"库目录",例:D:\Visual Stdio 2013\lipeng\boost\boost_1_58_0\stage\lib


关于一些问题解决:

1.Unknown compiler version while compiling Boost with MSVC 14.0 (VS 2015)

To stop Boost 1.58 complaining about unknown compiler version edit boost/config/compiler/visualc.hpp and replace:

// last known and checked version is 19.00.22129 (VC14 Preview):#if (_MSC_VER > 1800 && _MSC_FULL_VER > 190022310)

with:

// last known and checked version is 19.00.22816 (VC++ 2015 RC):#if (_MSC_VER > 1800 && _MSC_FULL_VER > 190022816)

which you can find is already done in boost repo here for upcoming Boost 1.59 release.

Update: For Visual Studio 2015 RTM set it to:

// last known and checked version is 19.00.23026 (VC++ 2015):#if (_MSC_VER > 1800 && _MSC_FULL_VER > 190023026)

Update2: For Visual Studio 2015 Update 1 set it to:

// last known and checked version is 19.00.23506 (VC++ 2015 Update 1):#if (_MSC_VER > 1800 && _MSC_FULL_VER > 190023506)

相关文章:

1.http://www.jianshu.com/p/de1fda741beb


2 0