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.

2008-09-15_173554

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

 2008-09-15_180035

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.

2008-09-15_173909

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.

2008-09-16_184319

Build the library again. Done.

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