天天看點

Boost 1.48.0編譯

1. 至http://www.boost.org/users/history/version_1_48_0.html下載下傳boost最新版1.48.0;

2. 解壓縮後,運作bootstrap.bat批處理檔案,得到bjam.exe;

3. 進入VS2008的Command Prompt (方法:Tools -> Visual Studio 2008 Command Prompt),轉到boost目錄。(例如,我的boost目錄:D:\boost_1_48_0)

4. 輸入“bjam --toolset=msvc-9.0 --build-type=complete stage”後,等待約1小時,完成編譯。編譯成的lib檔案,放在stage\lib下,形如“libboost_program_options-vc90-sgd-1_48.lib”.

備注:對于一般使用,可以選擇編譯boost庫(畢竟完整編譯需要時間還是比較長的),例如我一般編譯如下幾個boost常用庫system, thread, date_time, filesystem, serialization,則相應的bjam指令如下:

bjam --toolset=msvc-9.0 architecture=x86 address-model=64 --with-system --with-thread --with-date_time --with-filesystem --with-serialization

其中:msvc-9.0代表編譯成VC9.0(即VS2008)版本,對應的msvc-10.0代表編譯成VC10.0(即VS2010)版本; address-model=64代表編譯成64位版本,如省略此項,預設為編譯成32位版本。

早期版本編譯參考:(bjam指令可複用)

1_47_0: http://blog.csdn.net/great3779/article/details/6654780 

1_46_0: http://blog.csdn.net/great3779/article/details/6454663