From: Luis Lavena Date: 2010-10-13T12:27:29+09:00 Subject: [ruby-core:32768] Re: [Ruby-Bug#3802] freeaddrinfo not found in WS2_32.dll On Tue, Oct 12, 2010 at 11:44 PM, U.Nakamura wrote: > Hello, > >> Here is a patch for VC. > > Luis, how do you think this patch? > While patch applies and solve the redefinition (good), it raises again the broken IPv6 issue with undefined references:

gcc -shared -s -o ../../.ext/i386-mingw32/socket.so init.o constants.o
basicsocket.o socket.o ipsocket.o tcpsocket.o tcpserver.o
sockssocket.o udpsocket.o unixsocket.o unixserver.o option.o ancdata.o
raddrinfo.o getaddrinfo.o getnameinfo.o
-L. -L../.. -L.  -Wl,--enable-auto-image-base,--enable-auto-import
socket-i386-mingw32.def  -lmsvcrt-ruby191 -lws2_32  -lshell32 -lws2_32
-limagehlp
getaddrinfo.o: In function `get_addr':
C:\Users\Luis\Projects\oss\oci\rubyinstaller\sandbox\ruby19_build\ext\socket/../../../../../../ruby/ext/socket/getaddrinfo.c:587:
undefined reference to `getipnodebyname'
getaddrinfo.o: In function `get_name':
C:\Users\Luis\Projects\oss\oci\rubyinstaller\sandbox\ruby19_build\ext\socket/../../../../../../ruby/ext/socket/getaddrinfo.c:543:
undefined reference to `getipnodebyaddr'
C:\Users\Luis\Projects\oss\oci\rubyinstaller\sandbox\ruby19_build\ext\socket/../../../../../../ruby/ext/socket/getaddrinfo.c:555:
undefined reference to `freehostent__compat'
getaddrinfo.o: In function `get_addr':
C:\Users\Luis\Projects\oss\oci\rubyinstaller\sandbox\ruby19_build\ext\socket/../../../../../../ruby/ext/socket/getaddrinfo.c:660:
undefined reference to `freehostent__compat'
C:\Users\Luis\Projects\oss\oci\rubyinstaller\sandbox\ruby19_build\ext\socket/../../../../../../ruby/ext/socket/getaddrinfo.c:590:
undefined reference to `getipnodebyname'
C:\Users\Luis\Projects\oss\oci\rubyinstaller\sandbox\ruby19_build\ext\socket/../../../../../../ruby/ext/socket/getaddrinfo.c:669:
undefined reference to `freehostent__compat'
getaddrinfo.o: In function `get_name':
C:\Users\Luis\Projects\oss\oci\rubyinstaller\sandbox\ruby19_build\ext\socket/../../../../../../ruby/ext/socket/getaddrinfo.c:564:
undefined reference to `freehostent__compat'
getnameinfo.o: In function `getnameinfo__compat':
C:\Users\Luis\Projects\oss\oci\rubyinstaller\sandbox\ruby19_build\ext\socket/../../../../../../ruby/ext/socket/getnameinfo.c:227:
undefined reference to `getipnodebyaddr'
C:\Users\Luis\Projects\oss\oci\rubyinstaller\sandbox\ruby19_build\ext\socket/../../../../../../ruby/ext/socket/getnameinfo.c:240:
undefined reference to `freehostent__compat'
C:\Users\Luis\Projects\oss\oci\rubyinstaller\sandbox\ruby19_build\ext\socket/../../../../../../ruby/ext/socket/getnameinfo.c:246:
undefined reference to `freehostent__compat'
collect2: ld returned 1 exit status
Which I think was solved in r24517: http://redmine.ruby-lang.org/issues/show/1834 To quote your 3rd point in that ticket: "(3) link errors with --enable-wide-getaddrinfo is ruby's bug." -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup�ry