jonderry
jonderry

Reputation: 23633

How do I compile a simple c++ program that uses std::thread in cygwin?

#include < thread >

results in:

error: thread: no such file or directory

How can I install/use this library?

Upvotes: 0

Views: 161

Answers (2)

wkl
wkl

Reputation: 79893

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.

Upvotes: 1

thyrgle
thyrgle

Reputation:

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).

Upvotes: 0

Related Questions