Using boost 1.60 on winxp sp2

boost has dropped winxp support by default. However, it does offer option to allow binary to run on winxp.
We followed the options on http://www.boost.org/users/history/version_1_60_0.html , and the compiled binaries can run on winxp sp3. Sadly, not including winxp sp2.

Let’s take a look at the build instruction:

This release of Boost will by default compile for Windows Vista/Windows Server 2008, if the compiler supports a recent enough Windows SDK, and for Windows XP otherwise. Binaries compiled with default options may not run on the older Windows versions.

It is still possible to explicitly specify target Windows version by defining BOOST_USE_WINAPI_VERSION to a numeric version of Windows API. For example, building Boost for Windows XP can be done with the following command:

b2 release define=BOOST_USE_WINAPI_VERSION=0x0501

But the compiled binaries will get following error when running on winxp sp2.

The procedure entry point GetLogicalProcessorInformation could not be located in the dynamic link library KERNEL32.dll.

Use IDA to disassemble the binary, we can see it’s due to boost::thread::hardware_concurrency()
Here is its implement:

The variables BOOST_WINAPI_VERSION_WINXP, etc. are not defined either. These are defined in detail/winapi/config.hpp but this file does not appear to be included. Even if the user specified a winapi version via define, there would be no value to compare to.