The first thing to do is to see if your version of Boost supports
threading. Compiling and running something like the following should
tell you that:
#include <iostream>
#include <boost/regex.hpp>
int
main()
{
#ifdef BOOST_HAS_THREADS
std::cout << "Boost has threads" << std::endl;
#else
std::cout << "Boost doesn't support threads" << std::endl;
#endif
return 0;
}
The second thing is to verify that all of the requirements are met.
You've just posted the actual lines, not the context in which they are
executed. If the first line is in namespace scope, you should be OK
(unless you've started threading in constructors to static objects,
before entering main
: don't do that). If the first line has block
scope (i.e. is in a function), then you are only OK if the first call to
this function occurs before threading starts. (From what I understand,
with g++, you should be OK even if the first line has block scope, but
I'm not sure.)