
Stefan Slapeta wrote:
Michael Glassford wrote:
As suggested by Roland in his posted sample code, the default for VC++ linking of Boost.Threads is now static linking. I also changed all non-Win32 platforms to use static linking by default.
I still get an error from auto_link when including something from boost.thread and using any non-dynamic runtime:
C:\views_cvs\boost\boost/config/auto_link.hpp(269): catastrophic error: #error directive: "Mixing a dll boost library with a static runtime is a really bad idea..." # error "Mixing a dll boost library with a static runtime is a really bad idea..."
Is this intended?
I don't see how this can happen unless: a) your boost/thread/detail/config.hpp is out of date, or b) you're defining BOOST_THREAD_USE_DLL or BOOST_DYN_LINK. If you're sure neither of these is the case, could you determine which branch is being chosen in the complicated #if near the top of boost/thread/detail.config.hpp that looks like the following? #if defined(BOOST_HAS_WINTHREADS) # if defined(BOOST_THREAD_BUILD_DLL) //Build dll # define BOOST_THREAD_DECL __declspec(dllexport) # elif defined(BOOST_THREAD_BUILD_LIB) //Build lib # define BOOST_THREAD_DECL # elif defined(BOOST_THREAD_USE_DLL) //Use dll # define BOOST_THREAD_DECL __declspec(dllimport) # define BOOST_DYN_LINK # elif defined(BOOST_THREAD_USE_LIB) //Use lib # define BOOST_THREAD_DECL # else //Use default # if defined(BOOST_MSVC) //For VC++, choose according to threading library setting # if defined(_DLL) //Threading library is dll: use Boost.Threads dll # define BOOST_THREAD_USE_DLL # define BOOST_THREAD_DECL __declspec(dllimport) # define BOOST_DYN_LINK # else //Threading library is lib: used Boost.Threads lib # define BOOST_THREAD_USE_LIB # define BOOST_THREAD_DECL # endif # else //For compilers not yet supporting auto-tss cleanup //with Boost.Threads lib, use Boost.Threads dll # define BOOST_THREAD_USE_DLL # define BOOST_THREAD_DECL __declspec(dllimport) # define BOOST_DYN_LINK # endif # endif #else # define BOOST_THREAD_DECL # if defined(BOOST_THREAD_USE_LIB) //Use dll # define BOOST_THREAD_USE_DLL # define BOOST_DYN_LINK # elif defined(BOOST_THREAD_USE_DLL) //Use lib # define BOOST_THREAD_USE_LIB # else //Use default # define BOOST_THREAD_USE_LIB # endif #endif // BOOST_HAS_WINTHREADS Thanks, Mike