#4816 win2k: unresolved DLL imports

obsolete: 8.6b1.1
closed-fixed
5
2011-04-08
2011-04-08
No

Functions getaddrinfo(), getnameinfo() and freeaddrinfo() were introduced in winXP, and are not present on win2k.
Tcl relies on these functions in files generic/tclIOSock.c and generic/tclIOSock.c, resulting in unresolved imports from ws2_32.dll (see screenshot).

The fix is to include header "wspiapi.h". Read section titled "Support for XXX on earlier versions of Windows" at the bottom of articles:
getaddrinfo: http://msdn.microsoft.com/en-us/library/ms738520%28v=vs.85%29.aspx
getnameinfo: http://msdn.microsoft.com/en-us/library/ms738532%28v=vs.85%29.aspx
freeaddrinfo: http://msdn.microsoft.com/en-us/library/ms737931%28v=vs.85%29.aspx

Patch is trivial, but here it is:
diff -r orig/generic/tclIOSock.c src/generic/tclIOSock.c
15a16,19
> #if defined(_WIN32)
> #include <wspiapi.h>
> #endif
>
diff -r orig/win/tclWinSock.c src/win/tclWinSock.c
51a52,53
> #include <wspiapi.h>
>

Discussion

  • Jan Nijtmans

    Jan Nijtmans - 2011-04-08
    • assigned_to: mdejong --> nijtmans
    • status: open --> closed-fixed
     
  • Jan Nijtmans

    Jan Nijtmans - 2011-04-08

    Fixed in trunk

    Moved the #include to win/tclWinPort.h, and
    added a test to configure.in whether this
    include file actually esists.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks