tolua_runtime
tolua_runtime copied to clipboard
Conflicting types for inet_ntop 编译错误
在新版的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
luasocket/inet.h 中删除 LUASOCKET_INET_PTON 定义就编译通过了。
#ifdef __MINGW32__
#define LUASOCKET_INET_PTON
#endif
最新版 luasocket 已删除了这个。
是这个意思