In Solaris, the order of the libraries and objects, in link time, _does_ matter. So, instead of: -lboost_thread -lpthread -lposix4 main.o you have to put main.o -lboost_thread -lpthread -lposix4
That way, it works.
Don't forget that you *must* also compile with -pthreads and link with -pthreads, without this you won't have a thread safe std lib, and probably other problems as well (see gcc -dumpspecs for a full list of what -pthreads does on Solaris). The issue we're grappling with is
when you specify -pthreads in debug mode you will get an unresolved external from std::runtime_error::runtime_error, the fix is to place:
#pragma implementation "stdexcept"
in one of your source files (this isn't needed for release code
--- In Boost-Users@y..., "John Maddock"
should probably get this fix rolled into the thread lib itself at some stage.
If someone can provide me with a patch I'll be more then happy to fix this in Boost.Threads. Bill Kempf