http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52680
Bug #: 52680 Summary: std::this_thread::sleep_for #ifdef'd out by _GLIBCXX_USE_NANOSLEEP Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: mkl...@cs.wisc.edu Created attachment 26963 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26963 A short test program (13 lines) illustrating the problem Inside the thread header for C++11, _GLIBCXX_USE_NANOSLEEP is not defined on my system, causing std::this_thread::sleep_for to be undefined. However, defining it manually using -D_GLIBCXX_USE_NANOSLEEP causes the attached test program to compile successfully and behave as intended. I am using Ubuntu 10.04 LTS. The attached test code was successfully compiled using g++ -std=c++11 test.cpp -pthread -D_GLIBCXX_USE_NANOSLEEP