views:

55

answers:

2

#include < thread >

results in:

error: thread: no such file or directory

How can I install/use this library?

A: 

If you are using standard C++ you can't do this. You need C++0x.

Use either boost.thread or pthreads. (boost.thread is probably easier).

thyrgle
+1  A: 

Which version of GCC-C++ do you have installed? I believe <thread> is not included with GCC-C++ older than 4.4.

However, as you can read from this link: http://gcc.gnu.org/projects/cxx0x.html

<thread> is still experimental, and it is still recommended that you use boost.thread in the meantime.

birryree
The `<thread>` header is available in version 4.5.0-1 of the Cygwin gcc4 package, which is currently in testing. Using Cygwin's setup.exe, you can install it for example by pressing the 'Exp' button on the top right of the package selection screen.
ak2