Linking to release boost libs form debug build

I've noticed my boost libs are slowing my game down incredibly in my debug builds. I'd like to link to release boost libs even in Debug, is that possible and will it cause any problems? Heres what I've got so far: I've managed to stop my project from auto-linking to the generated lib names (by adding #define BOOST_ALL_NO_LIB), and listed the libs I want to include manually, but now I get link errors like this: libcmt.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in Libcmtd.lib(invarg.obj) It wants to link to the release RunTime, but my project is linking to the debug RunTime. So it seems that I want to create my boost libs so that they are release (and optimized), but link to the debug runtime. Is it even possible to build the libs like that? I'm studying boost jam now but having a hard time understanding how I would make libs as such. Thanks for any help you can offer, -John Thanks! -John -- View this message in context: http://www.nabble.com/Linking-to-release-boost-libs-form-debug-build-tp24454... Sent from the Boost - Users mailing list archive at Nabble.com.

I've noticed my boost libs are slowing my game down incredibly in my debug builds. I'd like to link to release boost libs even in Debug, is that possible and will it cause any problems?
Yes, as you've discovered the release and debug builds use different runtime libraries, and in short "you can't do that". What you could do is either: 1) Use a custom debug build of the Boost libraries (i.e. which link to the debug RTL) which has optimizations turned on. Or, 2) Switch to release build in your project, but then turn debug info on and optimizations off for your code, and let auto-linking pick the Boost lib for you. Please note that neither of the above will solve the problem if it's Boost template code instantiated in your object files that are the issue. HTH, John.

That does help, thank you. I ended up doing option 1, and there wasnt much speed up (so the problem is likely in the template instantiation, not the libs, as you mentioned) John Maddock wrote:
1) Use a custom debug build of the Boost libraries (i.e. which link to the debug RTL) which has optimizations turned on. Or, 2) Switch to release build in your project, but then turn debug info on and optimizations off for your code, and let auto-linking pick the Boost lib for you.
-- View this message in context: http://www.nabble.com/Linking-to-release-boost-libs-form-debug-build-tp24454... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
John Maddock
-
johnnyk427