2018-01-07 win10 vs2017 编译boost

G:\boost_1_58_0>b2.exe stage --toolset=msvc-14.0 --stagedir="g:\boost_1_58_0\bin1.58.0\vc14.1" threading=multi --build-type=complete --build-dir="g:\boost_1_58\build" --with-locale


具体介绍:

--toolset:设置编译器,如果用VC,设msvc, 用MinGW就设gcc。

stage:可选install,选stage只生成库(静态库和动态库),install还包含include目录,其实,可以直接用我们下载下来的BOOST包里的boost目录,这个目录和install生成的include目录内容基本一样。所以也就不用了。

--build-dir=”[temporary folder name”:编译的临时文件存放位置。

--stagedir=” stage folder name]”:存放编译后库文件的路径,默认是stage。

--build-type=complete:编译所有版本

{

  variant=debug|release        决定编译什么版本(Debug or Release?)

  link=static|shared           决定使用静态库还是动态库。

  threading=single|multi       决定使用单线程还是多线程库。

  runtime-link=static|shared   决定是静态还是动态链接C/C++标准库。

}

link:是动态库还是静态库,static | shared,一般默认静态。

address-mode:address-model=64,如果没有这个属性的话,会默认生成32位的平台库,加入这个选项才能生成64位的DLL。如果运行在VS32位的命令行下需要添加” architecture=x86”,笔者使用x64 Native Tools Command Prompt for VS 2017没有x86与x64之间的矛盾,所以未设置。

--with:选择要编译的库 库名在

你可能感兴趣的:(2018-01-07 win10 vs2017 编译boost)