-
Boost Auto-Linking
I am trying to build a library using boost auto-linking, and I am getting the error
"Mixing a dll boost library with a static runtime is a really bad idea"
Error 2 fatal error C1189: #error : "Mixing a dll boost library with a static runtime is a really bad idea..." c:\bin\boost 1.34.1\boost\config\auto_link.hpp 287
This is created from the auto link header stating
#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 don't know what to do, I know there are like single threaded and multi threaded rtls but um, I don't know how to change it (visual studio orcas) or like, what I'd really like is for the boost library to link into mine statically so I don't have to lug around boost_cocks-vc80-mt-gd-1_34_1.dll or whatever
-
Fix:
Code:
//# error "Mixing a dll boost library with a static runtime is a really bad idea..."
-
If I enable the multi-threaded dll runtime library, the error goes away. Commenting was just as effective too. I now just get the error
fatal error LNK1104: cannot open file 'boost_log-vc80-mt-1_34_1.lib' iTunesPlugIn
This is because my library doesn't seem to be getting built. My "bjam \boost\libs\xxx" created the hierarchy
C:\Bin\Boost 1.34.1\bin.v2\libs\log\build\msvc-8.0express\debug\link-static which contains
libboost_log-vc80-gd-1_34_1.lib
libboost_log-vc80-gd-1_34_1.lib.rsp
How can I adjust the auto-linking system to link to this library, or the bjam system to create the files the auto-linker is seeking
-
I've found certain bjam options like -sBUILD=release but I don't know what I'd do for the msvc toolkit to enable this, as it does not seem to make any difference unless I'm using mingw
-
twomers: Suggesting to ignore an error that says something is a "really bad idea" is a really bad idea.
Hmm ... do you have an include trace for the original error? I.e. do you know which boost header included auto_link.hpp in this case? Boost ought to auto-link statically by default, unless you have BOOST_ALL_DYN_LINK defined in your project options.
Also, which logging library is this? There is none in Boost 1.34, so you must have added an external one. Perhaps that's the reason the files aren't built?
-
>> twomers: Suggesting to ignore an error that says something is a "really bad idea" is a really bad idea.
No way! I was kidding, you know.