Boost logo

Boost Users :

Subject: [Boost-users] boost::thread Compile error with Sun Studio 12
From: Roman Morokutti (roman.morokutti_at_[hidden])
Date: 2009-05-14 17:29:55


When I compile the example on the boost::thread documentation
(the source is wrapped by a main function):

#include <stdlib.h>
#include <boost/thread.hpp>

int main(int argc, char** argv) {

     boost::system_time const timeout = boost::get_system_time() +

     extern bool done;
     extern boost::mutex m;
     extern boost::condition_variable cond;

     boost::unique_lock<boost::mutex> lk(m);
     while (!done)
         if (!cond.timed_wait(lk, timeout))
             throw "timed out";
     return (EXIT_SUCCESS);

I get the error

CC -library=stlport4 -mt -c -g -I/opt/boost/boost_1_39_0 -o
build/Debug/SunStudio-Solaris-x86/thread.o thread.cpp

"/opt/boost/boost_1_39_0/boost/thread/detail/thread.hpp", line 344: Error:
boost::thread::thread(boost::thread&) is not accessible from
1 Error(s) detected.

So could anyone tell me how to bypass this error, or should the library
be updated?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at