
通过boost官网网页,或直接在source forge下载boost_1_6x_0.
Zlib library, 环境变量: ZLIB_SOURCE
bzip2, 环境变量: BZIP2_SOURCE
ICU i18n, 环境数组HAVE_ICU=1, ICU_PATH
expat, 环境变量: EXPAT_INCLUDE (头文件包括目录) 和 EXPAT_LIBPATH (库目录)
下载完Boost源文件压缩包后, 创建boost-src目录, 并把源文件解压到此目录. 假设你想把Boost安装到boost-dir目录, boost-build目录是前面临时文件. 在命令行执行以下的流程:
"C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86

"C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
cd /d drive:\path\to\boost-src
bootstrap.bat
b2 install --libdir=boost-dir\libs --includedir= boost-dir\include --build-dir=boost-build --layout=tagged variant=debug,release threading=multi link=shared runtime-link=shared -sZLIB_SOURCE=<zlib-src-dir> -sBZIP2_SOURCE=<bzip2-src-dir>
b2 install --libdir=boost-dir\libs64 --includedir= boostdir\include --build-dir=boost-build64 --layout=tagged variant=debug,release threading=multi link=shared runtime-link=shared address-model=64 –sZLIB_SOURCE=<zlib-src-dir> -sBZIP2_SOURCE=<bzip2-src-dir>

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
cd /d F:\Develop\Libs\boost_1_6x_0
bootstrap.bat
1. 编译和安装32位库:
b2 install --libdir=G:\yy\build\libs --includedir=G:\yy\build\include --build-dir=boost-build --layout=tagged variant=debug,release threading=multi link=shared runtime-link=shared
2. 编译和安装64位库:
b2 install --libdir=G:\yy\build\libs64 --includedir=G:\yy\build\include --build-dir=boost-build64--layout=tagged variant=debug,release threading=multi link=shared runtime-link=shared address-model=64 architecture=x86

3. 编译和安装64位库(方式2):
b2 install --prefix=F:\Develop\bin\x64\boost-1_62 --build-dir=boost-build64 --layout=tagged variant=debug,release threading=multi link=shared runtime-link=shared address-model=64 architecture=x86 --with-thread --with-graph --with-date_time
4. 编译和安装64位库(2017-3-2 1.63):
b2 install --prefix=F:\Develop\bin\x64\boost-1_63 --build-dir=F:\Develop\build\VC14\boost-1_63-build64 address-model=64 architecture=x86 --with-thread
默认值:
--build-type=minimal 在Windows上, 生成基于共享运行库的debug和release静态多线程库
--layout=versioned 在Windows上默认win7vc2015安装失败,Boost二进制文件名称包含Boost版本号、编译器名称和版本和编码生成属性。

Boost头文件安装在<HDRDIR>子目录 <HDRDIR>的名字包括Boost版本号。
5. 编译和安装64位库(boost.python)(2017-3-18 1.63):
b2 install --prefix=D:\Develop\bin\vc14\x64\boost-1_63 --build-dir=D:\Develop\build\vc14\boost-1_63-build64 address-model=64 architecture=x86 toolset=msvc-14.0 --with-python link=shared
Boost默认启用手动链接功能, 建议采取关闭手动链接功能。
在附加预定义宏 加 BOOST_ALL_NO_LIBwin7vc2015安装失败,这样就关掉了BOOST的手动链接LIB的功能。然后把应该的lib库在附加库里自动加入。
1. 2016-11-09: 64位编译应该加入CPU架构参数: architecture=x86
2. 2016-11-23: 编译器的选择(x86_amd64, amd64等的区分), 内容进行了整理, boost升级到1.62.0
3. 2017-03-02: 使用默认参数编译, boost更新到1.63.0
4. 2017-04-15: 建议关闭boost自动链接功能
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-120906-1.html
啦啦啦啦啦啦啦啦啦啦啦啦啊啦啦啦啦老K
你可以去存余额宝啊
皇城脚下岂容他人放肆