Project scenario:
Problem Description:
There are some errors or warnings when compiling the project
warning C4005: “AF_IPX”: 宏重定义warning C4005: “AF_IPX”: 宏重定义
Cause Analysis:
It may be due to the redefinition caused by the <winsock.h> header file included in <windows.h>
solution:
- method 1:
WIN32_LEAN_AND_MEAN
Define the macro before including <windows.h> , as
follows:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
- Method 2:
Right-click the project->C/C+±>Add preprocessorWIN32_LEAN_AND_MEAN