Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2004-11-03 07:59:42


> When using the boost.thread package as a dll under vc7.1, one gets for
> each
> reference of boost::mutex the C4275 warning for the inherited noncopyable
> class (in fact 5 times, one for mutex, one for timed_mutex, one for
> try_mutex, one for thread, and one for thread_group!!)
>
> c:\boost\include\boost-1_32\boost\thread\mutex.hpp(34) : warning C4275:
> non - DLL-interface 'boost::noncopyable_::noncopyable' used as base for
> DLL-interface 'boost::mutex'
>
> In order to avoid such warning, it would be nice to redefine --
> again(sic) -- the BOOST_DECL macro and put it as a decorator for all
> dependent classes used by the boost libraries that could be generated as a
> dll.(thread, regex, filesystem, and so on).
>
> With the empty string as default value in boost/config.hpp, it would the
> responsability of each boost libraries to setup BOOST_DECL to the correct
> value when using it as a dll.

Except we only have one definition for non_copyable, so what happens if
library X wants it to have a dll interface and lib Y doesn't? It's also all
inline, so declaring it imported is a little strange. Maybe some #pragmas
to disable the warnings would be better, especially as we can't do much
about:

c:\data\boost\develop\boost\boost\thread\thread.hpp(75) : warning C4251:
'boost::thread_group::m_threads' : class 'std::list<_Ty>' needs to have
dll-interface to be used by clients of class 'boost::thread_group'
with
[
_Ty=boost::thread *
]

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk