std::this_thread::sleep_for() and GCC

Confirmed that it doesn’t work here as well. (Recent GCC 4.6 snapshot).

You could do the obvious and simply define it before you include any std:: headers. A bit dirty but will work until GCC fixes it (unless this is intended behavior). The #define shouldn’t break anything anyways. Either in source or -D_GLIBCXX_USE_NANOSLEEP flag to GCC.

You might want to try using -std=gnu++0x rather than -std=c++0x, since gnu++0x often pulls in stuff like this.

Leave a Comment