VS2010 Compile Error: #error: This file requires _win32_winnt to is #defined at least to 0x0403 ... The workaround

Source: Internet
Author: User


Recently got someone else's project, is to use vs.net created, and my machine only vs2010, so with the conversion tool to convert it into VS2010 project, before the conversion I was very worried, afraid of conversion after the problem, but there is no way, I really do not want to Ann a vs.net.

After the turn is sure to have a problem, in the re-build project, reported a lot of errors, the first of which is "fatal error C1189: #error: This file requires _win32_winnt to being #defined at Lea St to 0x0403. Value 0x0501 or higher is recommended "and then look at the source of the error, Unexpectedly is atlcore.h, this I have no language, this is the file that MFC bring, the likelihood of error basically is 0, so had to ask Gu uncle, found a lot of people have met this problem, read a few blog and post, probably understand, should be _win32_ Winnt This macro corresponds to the version number of the defined system, and if it is too low, the compiler will assume that the code cannot be compiled on the current system.

Said the reason, the following is the method of modification, is to modify the relevant definitions in the StdAfx.h file, the effect should be as follows:

  #ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later. #define WINVER 0x0501 // 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 0x0501 // 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 0x0501 // Change this to the appropriate value to target Windows Me or later. #endif #ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later. #define _WIN32_IE 0x0601 // Change this to the appropriate value to target IE 5.0 or later. #endi

VS2010 Compile Error: #error: This file requires _win32_winnt to is #defined at least to 0x0403 ... The workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.