error C2065: 'SwitchToThread' : undeclared identifier
我想用 SwitchToThread這個函式睡眠 但是會出現這個錯誤 有沒有大哥大神能指導下這個函式怎么用 。
https://msdn.microsoft.com/en-us/library/ms686352.aspx
這是這個函式的注釋
uj5u.com熱心網友回復:
HeaderWinBase.h on Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2 (include Windows.h);
Processthreadsapi.h on Windows 8 and Windows Server 2012
這3個頭檔案,總有一個可以吧
uj5u.com熱心網友回復:
那幾個頭檔案? 新手 還有很多不懂 能不能解釋下uj5u.com熱心網友回復:
詳細看MSDN注釋To compile an application that uses this function, define _WIN32_WINNT as 0x0400 or later.
uj5u.com熱心網友回復:
使用 Sleep(0);// 放棄當前行程剩余運行時間uj5u.com熱心網友回復:
這是未定義的錯誤。需要包含頭檔案WinBase.h,只要windows工程,這個頭檔案,默認是包含的。
你的專案選擇時,是不是控制臺程式,而不是windows程式吧?
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/72198.html
標籤:界面
下一篇:從影像上提取明亮細線
