E:\boost_1_48_0打開「Visual Studio 2008 Command Prompt」(設置環境變量的命令行),執行:
E:
cd boost_1_48_0
bjam --toolset=msvc-9.0 --build-type=complete stage
--toolset=msvc-9.0:對應 VS2008 (VC9);VS2010 用 msvc-10.0--build-type=complete:構建所有變體(debug/release、static/shared、threading=multi/single)stage:將編譯產出的 .lib/.dll 複製到 stage/lib 目錄,便於項目鏈接選擇性編譯(加速): 僅需部分庫(如 system、thread)時:
bjam --toolset=msvc-9.0 --with-system --with-thread stage
菜單:工具 → 選項 → 項目和解決方案 → VC++ 目錄,平台選 Win32:
E:\boost_1_48_0\stage\libE:\boost_1_48_0適用於全局設置;亦可在項目屬性中單獨配置「附加包含目錄」與「附加庫目錄」。
新建控制台項目,包含 <boost/version.hpp> 並輸出 BOOST_VERSION,或運行下一篇文章的 lexical_cast 測試程序。
b2 替代 bjam,參數兼容boost-vc14x 包,免編譯address-model=64 或在 x64 Native Tools 命令行構建