Today, we changed the original project from MFC to a non-MFC project, and many errors have occurred. Now we have recorded them as backups.
Summary:
> C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ ws2def. H (91): Warning c4005: "af_ipx": Macro redefinition
1> C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ Winsock. H (460): see the previous definition of "af_ipx ".
1> C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ ws2def. H (127): Warning c4005: "af_max": Macro redefinition
1> C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ Winsock. H (479): see the previous definition of "af_max"
1> C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ ws2def. H (163): Warning c4005: "so_dontlinger": Macro redefinition
1> C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ Winsock. H (402): see the previous definition of "so_dontlinger"
1> C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ ws2def. H (206): Error c2011: "sockaddr": "struct" type redefinition
1> C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ Winsock. H (485): See the sockaddr statement.
1> C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ ws2def. H (384): Error c2143: syntax error: "}" missing (before "constant)
1> C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ ws2def. H (384): Error c2143: syntax error: ";" missing (before "constant)
Solution: compile the project with the compilation header.
Add the following in stdafx. h:
# Ifndef win32_lean_and_mean
# Define win32_lean_and_mean
# Endif
# Include <winsock2.h>
# Include <windows. h>
Modify in targetver. h
# Ifndef winver // specify the required minimum platform as Windows Vista.
# Define winver 0x0600 // change this value to the appropriate value for other Windows versions.
# Endif
# Ifndef _ win32_winnt // The minimum platform required is Windows Vista.
# DEFINE _ win32_winnt 0x0600 // change the value to the corresponding value for other Windows versions.
# Endif
# Ifndef _ win32_windows // The minimum platform required is Windows 98.
# DEFINE _ win32_windows 0x0410 // change this value to an appropriate value for Windows ME or a later version.
# Endif
# Ifndef _ win32_ie // The minimum platform required is Internet Explorer 7.0.
# DEFINE _ win32_ie 0x0700 // change the value to the corresponding value to apply to other IE versions.
# Endif
Then compile
Stdafx. cpp File
This problem will not occur after compilation of other files.