|
Boost Users : |
Subject: Re: [Boost-users] boost::thread Compile error with Sun Studio 12
From: Roman Morokutti (roman.morokutti_at_[hidden])
Date: 2009-05-27 16:01:34
Thank you Steven for your help.
I have incorporated your patch into the code as shown in trac.
This time the library compiled well. The compiler I use is:
bash-3.2$ CC -V
CC: Sun Ceres C++ 5.10 SunOS_i386 2009/03/06
Usage: CC [ options ] files. Use 'CC -flags' for details
A little side node:
The code sample I used is from the boost documentation of
the thread's library at:
http://www.boost.org/doc/libs/1_39_0/doc/html/thread/time.html
Here's the code:
int main(int argc, char** argv) {
boost::system_time const timeout = boost::get_system_time() +
boost::posix_time::milliseconds(500);
extern bool done = true;
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);
}
But as with the code provided on the net (see link above) where
the variables (done, m, cond) are specified with extern, the linker
always moaned that it couldn't resolve those symbols. So IMHO this
example is not well suited for a standalone example.
-Roman
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net