Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-12-11 09:14:24


At 06:42 AM 12/11/2003, John Maddock wrote:
>
>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:"

That's still too polite. How about:

"Compiler threading support is not turned on. Please set the correct
command line options for threading. 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"

"Stopping compilation due to lack of correct compiler options for
threading."

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

"Compiler threading support is not turned on. Please set the correct
command line options for threading. Stopping compilation due to lack of
correct compiler options for threading."

(And yes, I think the idea is well worthwhile!)

--Beman


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