Loo*_*oom 27 c++ boost boost-build visual-c++ visual-studio-2012
如何使用Visual Studio C++ 11构建Boost(我试过1.48.0版本)?找不到工具集.我添加了工具集vc11 但收到了一条消息:bootstrap.batvc11F:\Programming\boost_1_48_0\tools\build\v2\engine\build.bat
ERROR: Cannot determine the location of the VS Common Tools folder.
Run Code Online (Sandbox Code Playgroud)
编辑:该费鲁乔 答案适用于VS 2012 Express和升压1.51.0过.
Con*_*ngo 39
这个答案非常有效:
VS2012 (Visual Studio 2012 Update 2)
VS2015(Visual Studio 2015 Update 2)简而言之
All Programs..Microsoft Visual Studio 2012..Visual Studio Tools..x64 Native Tools Command Prompt.boost_1_53_0.zip到C:\boost153.bootstrap.batbjam.exe(可选)分步说明
All Programs..Microsoft Visual Studio 2012..Visual Studio Tools..x64 Native Tools Command Prompt.cd c:\boost153.bootstrap.bat.bjam.exe.这构建了所有库.在大约5分钟后完成编译后,它会说:
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
C:/boost153
The following directory should be added to linker library paths:
C:\boost153\stage\lib
Run Code Online (Sandbox Code Playgroud)这很重要,我们需要将这两个路径添加到任何新的C++项目中.
C:/boost153给compiler include path和C:\boost153\stage\lib给linker library path.Properties,选择Configuration Properties..VC++ Directories.请参阅下面屏幕截图中的粗体文本的两部分):

让我们运行一个简单的程序,通过添加对foreach循环的支持来展示boost的强大功能:
// Source code below copied from:
// http://www.boost.org/doc/libs/1_53_0/doc/html/foreach.html
#include "stdafx.h"
#include <string>
#include <iostream>
#include <conio.h> // Supports _getch()
#include <boost/foreach.hpp>
int main()
{
std::string hello( "Hello, world!" );
BOOST_FOREACH( char ch, hello )
{
std::cout << ch;
}
_getch();
return 0;
}
Run Code Online (Sandbox Code Playgroud)结果:
Hello, world!
Run Code Online (Sandbox Code Playgroud)用Win10 x64+ VS2015.2+ 检查Boost v1.6.0.
小智 5
通过确认以下命令的输出来检查您的安装是否正确:
C:\>echo %VS110COMNTOOLS%
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
Run Code Online (Sandbox Code Playgroud)
以下是一些简单的说明,可以在引导时删除警告:http://landoftheninja.blogspot.com/2011/11/visual-c-11-and-boost.html
不要错过他关于自动链接的后续帖子.