VS6 C++ Compile error using "GetAddrInfo"

Hi,

Windows XP SP2. Platform SDK recently downloaded. VS6 C++ SP6.

I am using the 'GetAddrInfo' function ( DLL Ws2_32.dll) Header (
Ws2tcpip.h)

When compiling I get the error "c:\program files\microsoft platform
sdk\include\wspiapi.h(45) : error C2265: '<Unknown>' : reference to a
zero-sized array is illegal "

I believe there is some 'compatability' issue between IPv4 and IPv6
functions !! Not sure how to sort it though. IS it because the SDK stopped being compatible with VS6 sometime ago

Can anyone offer some ideas for what is I believe a not unique issue !

Thanks,

Jon.


Answer this question

VS6 C++ Compile error using "GetAddrInfo"

  • monk3yatthekeyboard

    this solution seems work well for me

    i encountered this error when i tried to use the struct ip_mreq


  • Aequitas

    Can you confirm the PSDK you dowloaded Was it the 2003 or 2005 version (Windows Server 2003 or Windows Server 2003 SP1)

    Unforntunately, the PSDK no longer supports VS6 C++. The headers and libs in the PSDK were created using VS7 or later compilers that support options not present in the VS6 compilers.

    For more information, check out the C++ team blog.



  • dude68

    Thanks for the reply.

    The SDK is 2003 SP1. I followed the web download.

    I will have a look at the Blog as you advise but can you point me in the direction of what options or workarounds are open to me

    Thanks.

  • c0nfig

    Try to define _WSPIAPI_COUNTOF before #include <Ws2tcpip.h>
    #define _WSPIAPI_COUNTOF
    #include <Ws2tcpip.h>


  • Tamer Ismael

    OK. Thanks again.

  • leviticus

    Unfortunately, I can no longer find the post that explained the changes other than my old post here.  (There seem to be some blogs.msdn issues with archives lately so don't be surprised if the link doesn't work the first time).

    Another place to seek help is the VC++ forum



  • VS6 C++ Compile error using "GetAddrInfo"