Boost logo

Boost Users :

From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2004-11-25 07:08:29


Peter Dimov wrote:

> It works as long as you don' allocate in one and delete in the other.
> C-style interfaces are fine, but passing a std::string from the EXE to
> the DLL (or vice versa) will fail. shared_ptr will work, though :-)
> unless you unload the DLL that has created it, of course. Deleting an
> object with a virtual destructor works, too.

That makes sense to me. A very convincing argument!
I would suggest to add this into the comment section of autolink.hpp:

#if (defined(_DLL) || defined(_RTLDLL)) && defined(BOOST_DYN_LINK)
# define BOOST_LIB_PREFIX
#elif defined(BOOST_DYN_LINK)
# error "Mixing a dll boost library with a static runtime is a really
bad idea..."
#else
# define BOOST_LIB_PREFIX "lib"
#endif

I really did not figure out from the message why this was a "really bad
idea..."
(Since there is no obvious technical reason.)

BTW.: I would even prefer this being a warning, since as long as beeing
careful
there are usages where it could be of advantage.

Roland


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