如何摆脱_WIN32_WINNT没有定义警告? [英] How to get rid of _WIN32_WINNT not defined warning?
问题描述
_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
此错误在我的编译期间持续弹出。它似乎不影响编译,但我应该如何摆脱它?
This error keeps popping up during my compilation. It doesn't seem to affect compilation, but how should I get rid of it? Am I risking anything by ignoring it?
推荐答案
它是通过WinSDKVer.h定义的。所以只需在源代码的顶部显式地定义它(例如在stdafx.h的开头),你就会摆脱警告。
It is defined for you through WinSDKVer.h. So just define it explicitly on the top of your source code (e.g. in the beginning of stdafx.h) and you will get rid of the warning.
相同的值(与来自WinSDKVer.h的 _WIN32_WINNT_MAXVER
相比)不太可能破坏任何东西。
Having it defined to the same value (as compared to _WIN32_WINNT_MAXVER
from WinSDKVer.h) is highly unlikely to break anything.
,用于Windows 7和.NET Framework 3.5 Service Pack 1的Windows®软件开发工具包(SDK)的WinSDKVer.h包含:
For example, WinSDKVer.h of Windows® Software Development Kit (SDK) for Windows 7 and .NET Framework 3.5 Service Pack 1 contains:
// This list contains the highest version constants supported by content
// in the Windows SDK.
// [...]
#define _WIN32_WINNT_MAXVER 0x0601
这篇关于如何摆脱_WIN32_WINNT没有定义警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!