After some headache: I made sure that an #include "Winsock2.h" is before any #include "windows.h" and "#include "Winsock.h" and this solved the case.
I checked the recursive includes, I spotted the header files which include (recursively) some #include "windows.h" and "#include "Winsock.h" and write a #include "Winsock2.h". in this files, i added #include "Winsock2.h" as the first include.
Just a matter of patience, look at includes one by one and establish this order, first #include "Winsock2.h" then #include "windows.h"