Two things:
1. You may not have #included
winsock2.h
directly, but some other file you DID #include, included it in turn, either directly or indirectly through yet another #include. (A quick search on my system shows 21 files containing "winsock2.h" in the include directory.)
2. If you want to reuse names that conflict with system names, consider using
namespaces[
^]
Alternatively, you can use the
Refactor/Rename
command in VS to do an intelligent renaming of YOUR symbol.
Peter