I am trying to use the std :: this_thread :: sleep_for () function, but got an error
error: 'std::this_thread' has not been declared .
The _GLIBCXX_USE_NANOSLEEP flag is enabled.
What else is needed to make it work?
MinGW ==> gcc version 4.7.2 (GCC)
SSCCE:
#include<thread> int main() { std::this_thread::sleep_for(std::chrono::seconds(3)); }
:
g++ -D_GLIBCXX_USE_NANOSLEEP -std=gnu++0x ssce.cpp -o ssce.exe
compilation result:
ssce.cpp: In function 'int main()': ssce.cpp:4:8: error: 'std::this_thread' has not been declared
source share