lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Apr 07, 2013 at 12:49:23PM -0700, Paul K wrote:
> Hi Victor,
> 
> > but in the linking
> > CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x9c):
> undefined reference to `_getaddrinfo'
> 
> I remember running into some similar issues (although I didn't use CMake);
> since I wanted to compile with mingw for Lua52, I patched luasocket to add
> inet_pton and inet_ntop support on Windows. I just pushed it to github as
> it was sitting locally for couple of months:
> https://github.com/pkulchenko/luasocket/tree/lua52-mingw
> 
> I also added build-mingw.sh script that compiles both luasocket DLLs. Just
> make Lua52 available or tweak the path in the script to point to your Lua52
> sources and see if this works for you.
> 
> Not sure why IPV6_V6ONLY should be 27, I compile it with the following
> parameters:
> 
> -Wl,-s -O2 -shared -D LUA_COMPAT_MODULE -D IPV6_V6ONLY=1 -D WINVER=0x0501
> -s -I src -I $LUA -L $LUA

IPV6_V6ONLY is a socket option (setsockopt(3)) originating with the
Basic Socket Interface Extensions for IPv6 (RFC 3493).

	http://tools.ietf.org/html/rfc3493.html#page-22

On BSDs the value of this option is `27'. Defining it to `1' is probably
wrong. It may do the right thing with #ifdef guarded code, but it may result
in weird things happening if the option is actually used.