Boost logo

Boost Users :

From: Jean-Francois Bastien (jfbastien_at_[hidden])
Date: 2008-08-12 11:23:17


> 1. With VS2005 it is NOT a GoodIdea(TM) to mix different
> types of binaries for one executable, since the (stupid)
> linker of vs2005 succeeds without error sometimes creating
> executables that fail to be debugged and/or crash at random
> points during execution. Summary: VC8 linker sucks in many
> aspects, so don't do that.

FWIW it is possible to mix debug/release DLLs with Visual Studio, I do
it with a lot of DLLs with success. You just have to be very careful
about a few things, for example:

 - Watch out for the one definition rule, especially across DLLs. Most
STL types in the standard Visual Studio library don't have the same size
in debug as in release! That includes std::string as well as the
containers (std::vector and others), and non-STL types with members that
exist depending on _DEBUG/NDEBUG. This can be mitigated by using the
proprocessor macros _SECURE_SCL=0 and _HAS_ITERATOR_DEBUGGING=0, but
this is a tradeoff. Violating that causes hard to debug stack
corruptions.

 - Make sure that allocation/deallocation is symetric. If you do a
new/malloc with one runtime and a delete/free with another you're asking
for trouble. Don't forget about the global new/delete too!

Basically you have to analyze what passes through DLL APIs.

JF


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net