narasimp has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to compile Socket6 module on windows. In 32 bit mode, it c +learly passed while it failed in 64 bit mode giving linker error. Socket6.obj : error LNK2001: unresolved external symbol __imp_inet_pto +n Socket6.obj : error LNK2001: unresolved external symbol inet_ntop ..\..\lib\auto\Socket6\Socket6.dll : fatal error LNK1120: 2 unresolved + externals I see that the required ws2_32.lib is present: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\ws2_32.lib" C:\VStudio10\VC\lib\oldnames.lib "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\kernel32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\user32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\gdi32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\winspool.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\comdlg32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\advapi32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\shell32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\ole32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\oleaut32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\netapi32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\uuid.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\ws2_32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\mpr.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\winmm.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\version.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\odbc32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\odbccp32.lib" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\comctl32.lib" Still it is failing. Is it that there is some issue with the SDK versi +on where ws2_32.lib is missing these two symbols? Please let me know +how to address this?

Replies are listed 'Best First'.
Re: Socket6 module compilation failing on Windows x86_64 with VS2K10
by syphilis (Archbishop) on Jan 08, 2016 at 07:06 UTC
    Hi,
    Earlier in the build (during the 'perl Makefile.PL' step) were there any "Warning (mostly harmless): No library found for..." warnings emitted ?

    Running
    dumpbin /EXPORTS C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\ws2_32.lib will show you the symbols that are exported by that library.

    Cheers,
    Rob
      Thanks a lot. It turned out to be that SDK was not present on the build box. Once we installed the same, it worked. Thanks a lot for the help here.
Re: Socket6 module compilation failing on Windows x86_64 with VS2K10
by VinsWorldcom (Prior) on Jan 08, 2016 at 13:26 UTC

    Yes, there is an issue with the older versions of the SDK - not sure if it has ever been fixed. Windows doesn't have headers for inet_ntop() and inet_pton() but they *ARE* included in the .a libraries. There is a fix described here:

    http://vinsworldcom.blogspot.com/2012/08/ipv6-in-perl-on-windows_20.html

    I wrote that post and used it to get Socket and Socket6 working on Windows 7 x64 with both 32-bit and 64-bit Strawberry Perl (various versions from 5.16 on).

    Not sure how / if this would work with VS2k10 or non-Strawberry, but give it a go and let us know.

      Thanks for the inputs. Since we are not supposed to alter the release build box, we were trying to check the version of SDK's. We saw that v7.0A SDK was not present. we installed and it is working fine now. Thanks a lot for this input. i am saving this info for future use.