Oh... The error message is not exactly straight-forward. I thought
something was broken.
Shouldn't the Boost.Threads documentation mention this? Such as in the
FAQ? It would've saved me quite a bit of time...
-----Original Message-----
From: boost-users-bounces@lists.boost.org
[mailto:boost-users-bounces@lists.boost.org] On Behalf Of Ben Hutchings
Sent: Friday, September 03, 2004 9:48 AM
To: boost-users@lists.boost.org
Subject: RE: [Boost-users] statically linking to Boost.Threads with
msvc7
Aaron Simmons wrote:
I've built and installed boost on a WinXp system with VS.Net
2003. I'm trying to use it in a static CRT project. I get the
following error whenever I compile:
> error C1189: #error : "Mixing a dll boost library with a
static runtime is a really bad idea..."
I noticed that this is happening because BOOST_DYN_LINK is
#defined in config.hpp. Apparently dynamic linking is the default for
Boost?
Windows does not support registration of clean-up functions for
thread-specific storage (TSS, or TLS), but it does notify DLLs when a
thread exits and this gives DLLs a chance to clean-up their
thread-specific storage. So in order to make TSS work correctly,
Boost.Threads is designed to be built only as a DLL on Windows. This
means, as the error message says, that you need to use the DLL version
of the CRT.
Ben.