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:設(shè)置編譯器,如果用VC,設(shè)msvc, 用MinGW就設(shè)gcc。
stage:可選install,選stage只生成庫(靜態(tài)庫和動態(tài)庫),install還包含include目錄,其實(shí),可以直接用我們下載下來的BOOST包里的boost目錄,這個目錄和install生成的include目錄內(nèi)容基本一樣。所以也就不用了。
--build-dir=”[temporary?folder name”:編譯的臨時文件存放位置。
--stagedir=” stage folder name]”:存放編譯后庫文件的路徑,默認(rèn)是stage。
--build-type=complete:編譯所有版本
{
??variant=debug|release??????? 決定編譯什么版本(Debug or Release?)
??link=static|shared?????????? 決定使用靜態(tài)庫還是動態(tài)庫。
??threading=single|multi?????? 決定使用單線程還是多線程庫。
??runtime-link=static|shared?? 決定是靜態(tài)還是動態(tài)鏈接C/C++標(biāo)準(zhǔn)庫。
}
link:是動態(tài)庫還是靜態(tài)庫,static | shared,一般默認(rèn)靜態(tài)。
address-mode:address-model=64,如果沒有這個屬性的話,會默認(rèn)生成32位的平臺庫,加入這個選項(xiàng)才能生成64位的DLL。如果運(yùn)行在VS32位的命令行下需要添加”?architecture=x86”,筆者使用x64 Native Tools Command Prompt for VS 2017沒有x86與x64之間的矛盾,所以未設(shè)置。
--with:選擇要編譯的庫 庫名在