Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

c++ - Cannot open include file 'thread'

I'm trying to use a threaded function for a parallel loop in a C++ program but I can't include <thread>, it keeps giving me the error

fatal error C1083: Cannot open include file: 'thread': No such file or directory

I'm running visual studio 2010 express, x64 (with x64 compiler options) and I believe I'm running the newest version of everything (Windows SDK 7.1) but I can't find an option in the props page for compiler version. (closest i found was Platform Toolset which is set to v100)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your compiler does not support C++11, so you need to upgrade/change the compiler. It seems that VS2012 supports it: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx.

As for the C++11 Standard Library, we don't have a pretty table of features, but Visual C++ in Visual Studio 2012 does implement it (...) New headers: atomic, chrono, condition_variable, future, mutex, ratio, scoped_allocator, and thread.

Few more links about C++11 support:

http://cpprocks.com/c11-compiler-support-shootout-visual-studio-gcc-clang-intel/

https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=118165827


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...