From: Andreas Huber (ah2003_at_[hidden])
Date: 2004-03-12 03:14:09
> I am trying out boost thread libraries with VC 7.1 Here are my
> includes :
> #define _MSC_VER 1310
> #define BOOST_LIB_NAME "boost_thread"
> #define BOOST_LIB_DIAGNOSTIC "on"// Show library file details.
> #include <boost/config/auto_link.hpp>
> #include <boost/thread/thread.hpp>
> #include <iostream>
> I am getting the following error :
> c:\Boost\include\boost-1_31\boost\config\auto_link.hpp(269) : fatal
> error C1189: #error : "Mixing a dll boost library with a static
> runtime is a
> really bad idea..."
> Looks like I am missing some #define.
You are not missing a #define, you have too many of them ;-). Seriously, you
typically don't need to define anything before including a boost library.
AFAICT, you neither need to include auto_link.hpp. You only include
thread.hpp, which then does the rest automatically.
The error you are getting is due to the fact that you are trying to link
with a static C runtime, which does not work because thread itself is linked
with a dynamic runtime. In MSVC you should use either /MDd or /MD and
everything will work just fine.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk