VS2010 컴파일 오류:fatal error C1189: #error:This file requires _WIN32_WINNT to be #defined at least to 0x0403...해결 방법
2255 단어 require
돌이켜보니 정말 문제가 생겼습니다. 다시 빌드 프로젝트를 할 때 많은 오류가 발생했습니다. 그 중 첫 번째는 "fatal error C1189: #error: This file requires _WIN32_WINNT to be #defined atleast to 0x0403. Value 0x0501 or higher is recommended"입니다. 그리고 오류의 출처를 보니atlcore입니다.h, 이건 어이가 없어요. 이것은 mfc가 가지고 있는 파일이에요. 오류 가능성은 기본적으로 0이에요. 그래서 곡 아저씨에게 가르침을 청할 수밖에 없어요. 많은 사람들이 이 문제에 부딪혔어요. 몇 편의 블로그와 게시물을 보고 대충 알았어요. 아마도_WIN32_WINNT라는 매크로가 정의된 시스템의 버전 번호입니다. 너무 낮으면 컴파일러는 코드를 현재 시스템에서 컴파일할 수 없다고 생각합니다.
원인을 말했습니다. 다음은 수정 방법입니다. 바로 stdafx입니다.h 파일에서 관련 정의를 수정하면 수정된 효과는 다음과 같습니다.
#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.
#endif
그러면 문제 없을 거예요.
참고 자료:
(1) http://topic.csdn.net/u/20100801/22/2a271d13-b3e9-419b-906c-039c8f3a5e0e.html
(2) http://blog.csdn.net/dongliqiang2006/archive/2010/08/13/5810055.aspx
(3) http://topic.csdn.net/u/20100401/14/c5b852d1-9934-4056-89f5-4a6041fe73de.html
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
실례를 통해 Nodejs 모듈 시스템 및 require 메커니즘 이해Nodejs에는 간단한 모듈 로딩 시스템이 있습니다.Nodejs에서 파일과 모듈은 하나의 독립된 모듈로 간주됩니다. 이 파일은 JavaScript 코드, JSON 또는 컴파일된 C/C++ 확장자일 수 있습니다. 2....
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.