使用 MSVC 11 (VS 2012) 进行增强编译
如何构建Boost(我尝试了版本1.48.0) 与 Visual Studio C++ 11? bootstrap.bat
找不到工具集 vc11
。我将工具集 vc11 添加到 F:\Programming\boost_1_48_0\tools\build\v2\engine\build.bat
但收到一条消息:
ERROR: Cannot determine the location of the VS Common Tools folder.
编辑: Ferruccio 答案适用于 VS 2012 Express 和 Boost 1.51.0 也是如此。
How to build Boost (I tried version 1.48.0) with Visual Studio C++ 11? bootstrap.bat
cannot find toolset vc11
. I added toolset vc11 to F:\Programming\boost_1_48_0\tools\build\v2\engine\build.bat
but got a message:
ERROR: Cannot determine the location of the VS Common Tools folder.
EDIT: The Ferruccio answer works for VS 2012 Express and Boost 1.51.0 too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这个答案非常适合:
VS2012
(Visual Studio 2012 Update 2)VS2015
(Visual Studio 2015 更新 2)简而言之
所有程序..Microsoft Visual Studio 2012..Visual Studio Tools..x64 Native Tools Command Prompt
。boost_1_53_0.zip
解压缩到C:\boost153
。bootstrap.bat
bjam.exe
(可选)分步说明
所有程序..Microsoft Visual Studio 2012..Visual Studio Tools..x64 Native Tools 命令提示符
。bootstrap.bat
。大约 5 分钟后编译完成,它会显示:
这很重要,我们需要将这两个路径添加到任何新的 C++ 项目中。
C:/boost153
添加到compiler include path
并将C:\boost153\stage\lib
添加到链接器库路径
。属性
,选择配置属性..VC++ 目录
。请参阅下面屏幕截图中粗体文本的两部分):让我们运行一个简单的程序,通过添加对
foreach
循环:结果:
更多答案
更新 2016-05-05
使用
Win10 x64
+VS2015.2
+Boost v1.6.0
检查。This answer works beautifully for:
VS2012
(Visual Studio 2012 Update 2)VS2015
(Visual Studio 2015 Update 2)In a nutshell
All Programs..Microsoft Visual Studio 2012..Visual Studio Tools..x64 Native Tools Command Prompt
.boost_1_53_0.zip
toC:\boost153
.bootstrap.bat
bjam.exe
(optional) Step-by-Step Instructions
All Programs..Microsoft Visual Studio 2012..Visual Studio Tools..x64 Native Tools Command Prompt
.cd c:\boost153
.bootstrap.bat
.bjam.exe
. This builds all of the libraries.When it has finished compiling after about 5 minutes, it states:
This is important, we will need to add these two paths to any new C++ project.
C:/boost153
to thecompiler include path
andC:\boost153\stage\lib
to thelinker library path
.Properties
, selectConfiguration Properties..VC++ Directories
. See the two portions of bolded text in the screenshot below):Let's run a simple program that shows off the power of boost, by adding support for
foreach
loops:Result:
More Answers
Update 2016-05-05
Checked with
Win10 x64
+VS2015.2
+Boost v1.6.0
.我设法按照以下步骤构建它:
它确实会生成很多关于无法检测工具包版本的警告,但无论如何它都会继续。
更新: 我创建了名为 cclibs 的 GitHub 存储库,这使得构建 Boost 和一些其他 C++ 库。
I managed to get it to build by following these steps:
It does generate a lot of warnings about not being able to detect the toolkit version, but it proceeds anyway.
Update: I created GitHub repo called cclibs which makes it simpler to build Boost and some other C++ libraries.
bootstrap.bat
bjam.exe --toolset=msvc-11
bootstrap.bat
bjam.exe --toolset=msvc-11
通过确认以下命令的输出来检查您的安装是否正确:
以下是一些简单的说明,可遵循以下一些简单说明来消除引导时的警告:http://landoftheninja.blogspot.com/2011/11/visual-c-11-and-boost.html
不要错过他的后续帖子涉及自动链接。
Check that your installation is correct by confirming the output of the following command:
Here's some simple instructions to follow to get rid of warnings when bootstrapping: http://landoftheninja.blogspot.com/2011/11/visual-c-11-and-boost.html
Don't miss his follow-up post that deals with the automatic linking.
vs2012 错误:无法确定 VS Common Tools 文件夹的位置。
vcvarsall.bat需要调用“C:\windows\system32\”中的“reg.exe”。
如果不在搜索路径中,将导致此错误。
将 C:\windows\system32 添加到 %PATH% 即可解决问题。
vs2012 ERROR: Cannot determine the location of the VS Common Tools folder.
vcvarsall.bat need call a "reg.exe" which in "C:\windows\system32\".
if not in search path,will cause this error.
Add C:\windows\system32 to %PATH% will solved the problem.
除了上述答案之外,我发现 BlueGo 对于使用 MSVC 10/11/12 构建 boost 版本确实很有帮助。您可以选择不同的配置,然后只需选择构建,就可以了。
In addition to above answers, I find BlueGo really helpful for building boost versions with MSVC 10/11/12. You can select different configurations and just select build, and it does the trick.