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.

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: