_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
这个错误在我的编译过程中不断弹出。它似乎不影响编译,但我应该如何摆脱它?我是否会因为忽略它而冒任何风险?
最佳答案
将其设置为您希望程序在其上运行的最旧的 Windows 操作系统。 此 MSDN 文章 Using the Windows Headers 中给出了可能的值。 .
You can define these symbols by using the
#define
statement in each source file, or by specifying the/D
compiler option supported by Visual C++.For example, to set
WINVER
in your source file, use the following statement:#define WINVER 0x0502 // Windows Server 2003 with SP1, Windows XP with SP2
To set
_WIN32_WINNT
in your source file, use the following statement:#define _WIN32_WINNT 0x0502 // Windows Server 2003 with SP1, Windows XP with SP2
To set
_WIN32_WINNT
using the/D
compiler option, use the following command:cl -c /D_WIN32_WINNT=0x0502 source.cpp
关于c++ - 如何摆脱 _WIN32_WINNT 未定义警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12871513/