欢迎关注公众号可以查看更多完整文章
使用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。