for winxp support
set INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE% set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH% set LIB=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;%LIB% REM (如果CL沒有定義則 set CL=/D_USING_V110_SDK71_ ) set CL=/D_USING_V110_SDK71_ %CL% REM (如果LINK沒有定義則 set LINK=/SUBSYSTEM:CONSOLE,5.01 ) set LINK=/SUBSYSTEM:CONSOLE,5.01 %LINK%
以上是設定compile需要的參數與搜尋順序 (SDK v7.1A first)
接下來build boost (這邊沒有使用icu or iconv)
bootstrap.bat
b2.exe -sBZIP2_SOURCE=D:\build\bzip2-1.0.6 -sZLIB_SOURCE=D:\build\zlib-1.2.11 toolset=msvc define=WINVER=0x0501 define=_WIN32_WINNT=0x0501 define=NTDDI_VERSION=0x05010000 define=PSAPI_VERSION=1
其他的選項
toolset=msvc
link=static,shared (.lib or .dll)
threading=multi
runtime-link=static,shared (/MT or /MD)
variant=debug,release
address-model=32 or 64
安裝路徑
install –prefix=
其他注意: 需要安裝SDK v7.1A 如果用VS2015自帶的win10 sdk 只能support Win7+
參考資訊:
http://www.boost.org/doc/libs/1_64_0/boost/detail/winapi/config.hpp (_WIN32_WINNT)
http://www.boost.org/build/tutorial.html
https://tedwvc.wordpress.com/2014/01/01/how-to-target-xp-with-vc2012-or-vc2013-and-continue-to-use-the-windows-8-x-sdk/