以 1.58.0 版本 boost 爲例, 當前系統版本爲 Windows 8.1 x64 bootstrap
1 編譯boost 多線程
當前解壓路徑 "D:\Libraries\boost_1_58_0" 測試
1) 打開VS2013命令提示符 ui
2) 運行 bootstrap.bat spa
注意全程不要關閉命令提示符, 全部操做均在此中完成線程
3) 運行 b2.exe 或 bjam.exe debug
① 查看編譯選項, 在命令提示符下輸入"b2 --help"3d
請注意如下幾個編譯選項blog
Properties:it
toolset=toolset
Indicate the toolset to build with.
variant=debug|release
Select the build variant
link=static|shared
Whether to build static or shared libraries
threading=single|multi
Whether to build single or multithreaded binaries
runtime-link=static|shared
Whether to link to static or shared C and C++ runtime.
② 編譯, 在命令提示符下輸入"b2 link=static threading=multi"
注意此處的選項要根據工程的須要去編譯, 若是僅僅爲了測試編譯過程, 能夠不帶任何參數
2 使用boost
在工程的屬性設置"VC++ Directories"中的Include和Library中增長boost, 以下圖配置
3 注意事項
1) 連接不成功, 找不到xxx.lib
多是編譯選項和boost的編譯選項不一致致使的,
請按照工程的編譯選項從新編譯boost或修改vs的配置和boost中配置一致.
2) 屢次編譯boost, 使用b2編譯時, 可不作清理, 可同時編譯出debug和release版本, 多線程和單線程版本