C++11 'yield' is not a member of 'std::this_thread'

原因:GCC没有定义这个宏:_GLIBCXX_USE_SCHED_YIELD

解决办法:编译时加上选项:-D_GLIBCXX_USE_SCHED_YIELD

或者:长远打算修改gcc的c++config.h文件去定义这个宏。

详情:'yield' is not a member of 'std::this_thread'  

see also: C++11 error: ‘sleep_for’ is not a member of ‘std::this_thread’

你可能感兴趣的:(C++11 'yield' is not a member of 'std::this_thread')