Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2003-12-11 06:42:50


This issue is coming up so often we need to provide a better error message
scheme, when users see:

c:\data\boost\develop\boost\boost\thread\mutex.hpp(17): fatal error C1189:
#error : Thread support is unavailable!

They assume it's a bug in the library rather than a compile time problem on
their part.

How about a new header - lets say boost/thread/errors.hpp that gets included
whenever BOOST_HAS_THREADS is undefined and issues the appropriate messages
with helpful comments on how to turn on threading support, for example:

#ifdef __GNUC__
#pragma warning "Threading support unavailable, please check that you are
using the correct command line options, for example:"
#pragma warning " -pthread (on linux)
#pragma warning " -pthreads (on solaris)
#pragma warning " -mthreads (on mingw32)
#error "stopping compilation due to lack of threading support in the
compiler"

#elif other_comiler
// whatever
#else
#error "stopping compilation due to lack of threading support in the
compiler, please check your compiler options"
#endif

John.


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