Mingw64编译错误 error: unknown type name 'SOCKET_ADDRESS' SOCKET_ADDRESS Address;解决方法

xingyun86 2018-4-2 2688

I'm failed to compile libuv v1.9.0 in mingw64. but it works when I use libuv v1.8.0.

My environment:

  • mingw64: msys2, mingw64_shell
  • libuv version: v1.9.0

错误信息如下:

Error messages here:

$ make
  CC       src/libuv_la-fs-poll.lo
In file included from ./src/win/winsock.h:26:0,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:92,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from ./include/uv-win.h:32,
                 from ./include/uv.h:60,
                 from src/fs-poll.c:22:
C:/msys64/mingw64/x86_64-w64-mingw32/include/iptypes.h:79:5: error: unknown type name 'SOCKET_ADDRESS'
     SOCKET_ADDRESS Address;
     ^
C:/msys64/mingw64/x86_64-w64-mingw32/include/iptypes.h:97:5: error: unknown type name 'SOCKET_ADDRESS'
     SOCKET_ADDRESS Address;
     ^
C:/msys64/mingw64/x86_64-w64-mingw32/include/iptypes.h:124:5: error: unknown type name 'SOCKET_ADDRESS'
     SOCKET_ADDRESS Address;
     ^
C:/msys64/mingw64/x86_64-w64-mingw32/include/iptypes.h:138:5: error: unknown type name 'SOCKET_ADDRESS'
     SOCKET_ADDRESS Address;
     ^
C:/msys64/mingw64/x86_64-w64-mingw32/include/iptypes.h:156:5: error: unknown type name 'SOCKET_ADDRESS'
     SOCKET_ADDRESS Address;
     ^

It works after I add -DWIN32_LEAN_AND_MEAN to Makefile.mingw。

解决方案:

添加-DWIN32_LEAN_AND_MEAN编译标识

×
打赏作者
最新回复 (0)
只看楼主
全部楼主
返回