tolua_runtime icon indicating copy to clipboard operation
tolua_runtime copied to clipboard

Conflicting types for inet_ntop 编译错误

Open XINCGer opened this issue 4 years ago • 2 comments

image 在新版的msys2(msys2-x86_64-20200629.exe)上编译tolua_runtime会报上面的错误。 原因是新版的msys2中已经带有了inet_pton了,即inet_pton已经存在于mingw的ws2tcpip.h文件了,将luasocket/inet.c和luasocket.h中有关该函数相关声明与定义注释掉以后,可以编译通过。 https://docs.microsoft.com/zh-cn/windows/win32/api/ws2tcpip/nf-ws2tcpip-inet_pton

luasocket仓库那边也提交过相关的Issue:https://github.com/diegonehab/luasocket/issues/298

XINCGer avatar Jul 17 '20 06:07 XINCGer

luasocket/inet.h 中删除 LUASOCKET_INET_PTON 定义就编译通过了。

#ifdef __MINGW32__
#define LUASOCKET_INET_PTON
#endif

最新版 luasocket 已删除了这个。

jinq0123 avatar Sep 02 '20 03:09 jinq0123

是这个意思

XINCGer avatar Sep 02 '20 04:09 XINCGer