error C1189:#error:This file requires _WIN32_WINNT to be #defined at least to 0×0403

來源:互聯網
上載者:User

出現 

error C1189:#error:This file requires _WIN32_WINNT to be #defined at least to 0x0403是由於原工程與現在你的系統不相容導致的,一般是原工程的版本較低,現在的版本較高,不能相容。糾正方法是:首先 找到stdafx.h標頭檔(一般標頭檔定義都在這裡,首選就是找這裡),前3段是關於系統的(幹涉,此處就是系統不相容,所以全部注釋掉),最後1段是講IE的(不干涉,預設處理) 注釋掉前3 個低版本的//#ifndef WINVER
// Allow use of features specific to Windows 95 and Windows NT 4 or later.
//#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
//#endif
//
//#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
//#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
//#endif
//
//#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
//#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
//#endif2 添加新的本本
#define WINVER 0x0500
#define _WIN32_WINNT 0x0500
#ifndef WINVER     // 允許使用特定於 Windows XP 或更高版本的功能。
#define WINVER 0x0501   // 將此值更改為相應的值,以適用於 Windows 的其他版本。
#endif

3 下面這個是IE的不用管
#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later.
#endif

這樣就不會出錯了

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.