std::this_thread::sleep_for() and GCC

前端 未结 4 501
傲寒
傲寒 2020-12-02 22:21

When I try to compile this simple program:

#include

void f() {
  std::this_thread::sleep_for(std::chrono::seconds(3));
}

int main() {
  std::         


        
4条回答
  •  独厮守ぢ
    2020-12-02 23:25

    Additional information, in case it helps someone:

    I do not need to define _GLIBCXX_USE_NANOSLEEP in Ubuntu 11.10, gcc 4.6.1, glibc 2.13.

    But I do need to compile with -D_GLIBCXX_USE_NANOSLEEP on Gentoo, gcc 4.6.1, glibc 2.12.2.

    I am not going to compile the Gentoo system for updating the glibc. At least not before the weekend ;)

提交回复
热议问题