compat.h:29:15: error: conflicting declaration 'typedef u_int SOCKET'
and
_socket_types.h:11:18: error: 'SOCKET' has a previous de
claration as 'typedef UINT_PTR SOCKET'
Tells you that the type SOCKET
has been defined in two different ways.
Get rid of or modify one of those typedefs.
It's also possible that you're including something you don't need to be including.