Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

procedure entry point freeaddrinfo could not be located in WS2_32.dll

95 views
Skip to first unread message

chs_b...@yahoo.com

unread,
Aug 10, 2006, 5:24:16 PM8/10/06
to
I'm working with a small MFC C++ desktop application built in Visual
Studio 2005, which calls a web service. When this application is run on
a Windows 2000 machine, it gives an error message:
The procedure entry point freeaddrinfo could not be located in the
dynamic link library WS2_32.dll

I'm not calling freeaddrinfo or getaddrinfo directly, but apparently
these are referenced from ATL. I've seen other threads and articles on
this problem (below), but have not been able to correct it. I've tried
#define _WIN32_WINNT 0x0500. I've tried #include <Wspiapi.h> in
atlsocket.h. No luck.

http://blogs.msdn.com/seshadripv/archive/2005/10/21/483408.aspx">http://blogs.msdn.com/seshadripv/archive/2005/10/21/483408.aspx
http://www.codeguru.com/forum/printthread.php?t=353899
http://groups.google.com/group/microsoft.public.vc.atl/browse_thread/thread/fabbe3a88b05a354/82d1e724a2fe5361?lnk=st&q=&rnum=9&hl=en#82d1e724a2fe5361

Has anyone run into this problem before? Successfully solved it? Many
thanks!

Brian Muth

unread,
Aug 10, 2006, 6:11:20 PM8/10/06
to
Why not just write your own GetAddrInfoW that in term calls GetAddrInfoA. Of
course you will need to convert to/from UNICODE and ASCII as needed.

Brian


chs_b...@yahoo.com

unread,
Aug 15, 2006, 3:36:37 PM8/15/06
to
A coworker who is more knowledgeable in this area helped me find a
solution. Here is what we did:

Install Microsoft Platform SDK, PSDK-x86.exe, from: Platform SDK
Install. Select Custom install and install only Build Environment (x86
32-bit) under Microsoft Windows Core SDK

In Visual Studio, click on Tools, Options. In the Options window, go to
Projects and Solutions, VC++ Directories. In the dropdown in
upper-right, select Include files. Add the Platform SDK include path
(e.g. C:\Program Files\Microsoft Platform SDK\Include) and make sure it
is the top-most entry. Similarly, select Library files and add the
Platform SDK Lib path.

Make changes to stdafx.h:
At the beginning of the file:
#define _WIN32_WINNT 0x0500
#define WINVER 0x0500

At the end of the file:
#include <WinSock2.h>
#include <Ws2tcpip.h>
#include <Wspiapi.h>
#include "WebService.h" // this line should already be there - put
other three includes before it

0 new messages