สวัสดี มีใครลองใช้การรองรับส่วนหัว 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 หนึ่ง จะเปิดใช้งานการสนับสนุน posix ได้อย่างไร?