开发者

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

#inclu开发者_StackOverflow中文版de < thread >

results in:

error: thread: no such file or directory

How can I install/use this library?


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜