lua-users home
lua-l archive

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

Thank you. I managed to build with my CMAKE file after definning IPV6_V6ONLY=27 -D WINVER=0x0501 with the branch you added.
It would be good to incorporate it to the main branch or perhaps leave IPV6 support as a configurable option in the main branch
----- Original Message -----
From: Paul K
Sent: Sunday, April 07, 2013 9:49 PM
Subject: Re: luasocket unstable IPV6_V6ONLY undefined in mingw

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:

I also added 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


On Sun, Apr 7, 2013 at 12:11 PM, Victor Bombi <> wrote:
I saw it and added
#ifndef IPV6_V6ONLY
#define IPV6_V6ONLY 27
to tcp.c options.c and udp.c
but in the linking

CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x9c): undefined reference to `_getaddrinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x156): undefined reference to `_getnameinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x19a): undefined reference to `_freeaddrinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x25e): undefined reference to `_getnameinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x2e2): undefined reference to `_getnameinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x36e): undefined reference to `_getnameinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x3e2): undefined reference to `_getaddrinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x4db): undefined reference to `_getnameinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x590): undefined reference to `_freeaddrinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x91d): undefined reference to `_inet_ntop'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0x9c1): undefined reference to `_inet_ntop'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0xaf5): undefined reference to `_inet_ntop'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0xb99): undefined reference to `_inet_ntop'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0xd5b): undefined reference to `_getaddrinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0xd79): undefined reference to `_freeaddrinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0xe79): undefined reference to `_getaddrinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0xe97): undefined reference to `_freeaddrinfo'
CMakeFiles\socket.dir/objects.a(inet.c.obj):inet.c:(.text+0xf34): undefined reference to `_freeaddrinfo'
CMakeFiles\socket.dir/objects.a(tcp.c.obj):tcp.c:(.text+0x201): undefined reference to `_getaddrinfo'
CMakeFiles\socket.dir/objects.a(tcp.c.obj):tcp.c:(.text+0x223): undefined reference to `_freeaddrinfo'
CMakeFiles\socket.dir/objects.a(tcp.c.obj):tcp.c:(.text+0x308): undefined reference to `_freeaddrinfo'
CMakeFiles\socket.dir/objects.a(udp.c.obj):udp.c:(.text+0x990): undefined reference to `_inet_ntop'
CMakeFiles\socket.dir/objects.a(udp.c.obj):udp.c:(.text+0xa08): undefined reference to `_inet_ntop'
CMakeFiles\socket.dir/objects.a(udp.c.obj):udp.c:(.text+0xb5d): undefined reference to `_inet_pton'
CMakeFiles\socket.dir/objects.a(udp.c.obj):udp.c:(.text+0xc39): undefined reference to `_inet_pton'

I cant find how to solve it