VS编译Boost库时,出现错误

欢迎关注公众号可以查看更多完整文章

 

使用VS2013的VS2013 x64 Native Tools Command Prompt编译boost库时,进入目录运行bootstrap.bat,出现错误:

如下:

Building Boost.Build engine


Failed to build Boost.Build engine.
Please consult bootstrap.log for furter diagnostics.


You can try to obtain a prebuilt binary from


   http://sf.net/project/showfiles.php?group_id=7586&package_id=72941


Also, you can file an issue at http://svn.boost.org
Please attach bootstrap.log in that case.

打开bootstrap.log查看,有如下信息:

ERROR: Cannot determine the location of the VS Common Tools folder.



在网上查找解决方法,有两种:

最常用的一种是:在环境变量中的Path对应的项添加:C:\Windows\System32,然后重启电脑,问题解决。

另一种是使用VS2015的MSBuild Command Prompt for VS2015命令行工具,也可以运行。


最后运行如下命令就可以将boost源码编译为64位静态库了:

bjam.exe stage --toolset=msvc-12.0 --stagedir=".\bin\vc12_x64" link=static runtime-link=shared threading=multi debug release address-model=64 

这里的runtime-link=shared编译出来的静态库,名称中没有s,如果使用runtime-link=static,编译得到的静态库的名称中会比shared模式多一个s。

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

GreenArrowMan

请打钱~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值