C++ mingw 5 std::未定义此线程

C++ mingw 5 std::未定义此线程,c++,c++11,mingw,c++14,C++,C++11,Mingw,C++14,嗨,有人试着使用收割台支架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 &l

嗨,有人试着使用收割台支架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";
}
#包括
#包括
#包括
int main()
{ 

std::cout您可以使用
i686-w64-mingw-g++
的更新选项,并从
i686-w64-mingw-g++-win32
将其设置为
i686-w64-mingw-g++-posix

或者您可以使用
i686-w64-mingw-g++-posix
进行编译。
还有其他版本,因此在本例中,您将使用64位编译器,并将
-posix
附加到它。

注释不用于扩展讨论;此对话已被删除。