首先,我的是VC9.0,對應的是ICUC4C 4.4.2版本,要先去ICU的首頁上下載ICU4C 4.4.2,只需要下載編譯好的包就行了。
32位 http://download.icu-project.org/files/icu4c/4.4.2/icu4c-4_4_2-Win32-msvc9.zip
64位 http://download.icu-project.org/files/icu4c/4.4.2/icu4c-4_4_2-Win64-msvc9.zip
假設解壓ICU檔案夾放在D:\dev\icu。
然後在VS2008的CMD下進入boost主資料夾,並用如下命令編譯
32位
bjam -s ICU_PATH=d:\dev\icu --toolset=msvc-9.0 --with-regex --build-type=complete stage address-model=32
64位
註:必須在Visual Studio 2008 x64 Win64 Command Prompt中編譯
bjam -s ICU_PATH=d:\dev\icu --toolset=msvc-9.0 --with-regex --build-type=complete stage architecture=x86 address-model=64
產生的lib和dll檔案都被移到boost主資料夾下的stage檔案夾中
註:64位系統可以編譯32位的boost+icu,需要的icu為32位,編譯命令同32位
在VC9中,除了要在include和lib中添加ICU相應的include和lib路徑,還需要在編寫的代碼中加上
#pragma comment(lib, "icuuc.lib")#pragma comment(lib, "icuin.lib")#pragma comment(lib, "icudt.lib")
有更多問題
可以訪問這裡
http://devwiki.neosys.com/index.php/Building_Boost_32/64_on_Windows