Monthly Archives: September 2008

How to link boost 1.36 against VC2008 SP1 CRT

For reasons described here, by default, VC 2008 would link all runtime dependencies to the OEM version, which is "9.0.21022.8", even if SP1(version=’9.0.30729.1′) is installed.


This behavior can be changed by defining _BIND_TO_CURRENT_VCLIBS_VERSION in the project setting.


However, if your project links to a 3rd-party library(for instance, boost) which is build without the macro be defined. your final executable will end up linking to two versions of Runtime, OEM and SP1, at the same time.


To build boost with the SP1 runtime, you need to go to the jam file of each library and add this macro,  and rebuild it.

Take boost.thread as an example, edit the jamfile.v2  at \libs\thread\build and insert one line.


Build the library again. Done.

The same method is applicable for other Boost libraries such as Filesystem.