编译Boost库

VS版本:

虽然网络上有,但是还是记录下,找到VS的command prompt,然后切换到boost的根目录:

1.运行 bootstrap.bat

它在当前目录下会生成b2.exe2.

2.运行b2.exe install --prefix=./bin  --build-dir=./build toolset=msvc link=static,shared threading=multi runtime-link=shared address-model=32 variant=debug,release --build-type=complete stage

MinGW版本:

运行b2.exe install --prefix=./bin --build-dir=./build toolset=gcc link=static,shared threading=multi runtime-link=shared address-model=64 variant=debug,release --build-type=complete stage

解释下上面的toolset不用说了,是编译工具链,可以替换成gcc

link是指生成出来的bin是静态库还是动态库 static, shared

threading是使用多线程运行时还是单线程运行时库,MSVC里面链接运行时库有这个选项 /MT /MD等

runtime-link,是指定链接静态运行时库还是动态运行时库。

address-model,是指定生成出来的目标bin,是32位还是64位

variant,是指定生成出来的目标bin是debug还是release版

其他参数不需要解释了

references:

http://blog.csdn.net/chenjh213/article/details/42265605

http://blog.csdn.net/zengraoli/article/details/51322484

http://blog.csdn.net/xie1xiao1jun/article/details/50477073

http://www.boost.org/doc/libs/1_63_0/more/getting_started/windows.html#id13

http://www.boost.org/build/doc/html/bbv2/overview/invocation.html

原文地址:https://www.cnblogs.com/foohack/p/6647652.html