2011/9/28 niXman <i.nixman@gmail.com>
It is a known problem and probably due to an operation libstdc++ does when
std::thread is used that winpthreads doesn't like but should allow. I don't
know how to fix this, sorry. Maybe Kai or JonY have more ideas on the
matter.

Ruben
Hi Ruben!

Tell me, if I use pthread-win32 instead winpthreads would it solve this problem?

No, you can't use std::thread with pthreads-win32. It doesn't support all the required functionality.
 
Or, maybe You know how to build mingw with "--enable-static --enable-shared" using winpthread just as a static library?

That is not only impossible, it wouldn't be right. This would allow mulltiple instances of winpthreads  (the statically linked one in the libstdc++ dll, the libgcc dll, the libgomp dll etc) to exist side by side, and this would lead to... anarchy.

Your best bet is to either build all your prerequisites as static libraries if possible (so exceptions are all thrown in one binary, the final executable, or don't use std::thread yet.

Ruben