views:

54

answers:

1

Hi, in the Winsock2 library getaddrinfo() and freeaddrinfo() was only added in Windows XP and on. I know how to replace them in legacy systems, but a conditional use depending on the Windows version won't help.

The application won't start in 9x with a message saying that it was linked to a missing export in WS2_32.dll.

I'm using MinGW to compile and link the code and would like to keep using it. Maybe writing those functions by myself?

Thank you very much for everything.

+3  A: 

You can use LoadLibrary and GetProcAddress to (attempt to) get the addresses of getaddrinfo and freeaddrinfo, then call them via the pointers iff GetProcAddress returns a non-NULL pointer.

Jerry Coffin
...and here is the way to do it. :) +1
andras
Thank you very much!
Sam C.