【发布时间】:2015-02-24 00:10:34
【问题描述】:
您好,有没有人尝试使用 header 支持 mingw w64?
main.cpp: In function 'int main()':
main.cpp:9:10: error: 'std::this_thread' has not been declared
std::this_thread::sleep_for( dura );
^
我通过以下简单测试得到了上述错误
#include <iostream>
#include <chrono>
#include <thread>
int main()
{
std::cout << "Hello waiter" << std::endl;
std::chrono::milliseconds dura( 2000 );
std::this_thread::sleep_for( dura );
std::cout << "Waited 2000 ms\n";
}
我想使用此处指定的最新 N3653 和 N3651 https://gcc.gnu.org/projects/cxx1y.html,当然还有线程支持标头,使用此处找到的某人构建 http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/dongsheng-daily/5.0/ 而且我的 c++config.h _GLIBCXX_USE_NANOSLEEP 没有定义,知道吗?
[编辑] 我意识到我的线程模型是:win32 而不是 posix one。如何启用 posix 支持?
【问题讨论】:
-
评论不用于扩展讨论;这个对话是moved to chat。