getaddrinfo could not be located in the dynamic link library WS2_32.

‘getaddrinfo’ could not be located in the dynamic link library WS2_32.

Article ID : 955045
Last Review : June 27, 2008
Revision : 1.0
Source: Microsoft Support

Back to the top

RAPID PUBLISHING

RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.

Back to the top

Action

Create a VC++ console-based application that links statically with MFC and execute it on the Windows Server 2000 (or earlier) operating system.

Back to the top

Result

You get a fatal error message:
The procedure entry point getaddrinfo could not be located in the dynamic link library WS2_32.dll

Back to the top

Cause

The getaddrinfo (http://msdn.microsoft.com/en-us/library/ms738520.aspx) function was added to the Ws2_32.dll on Windows XP and later.

Back to the top

Resolution

To execute an application using this function on earlier versions of Windows (Windows 2000, Windows NT, and Windows Me/98/95), then it is mandatary to #include Ws2tcpip.h and also Wspiapi.h. When the Wspiapi.h header file is included, the ‘getaddrinfo’ function is #defined to the ‘WspiapiGetAddrInfo’ inline function in Wspiapi.h. At runtime, the ‘WspiapiGetAddrInfo’ function is implemented in such a way that if the Ws2_32.dll or the Wship6.dll (the file containing getaddrinfo in the IPv6 Technology Preview for Windows 2000) does not include ‘getaddrinfo’, then a version of ‘getaddrinfo’ is implemented inline based on code in the Wspiapi.h header file. This inline code will be used on older Windows platforms that do not natively support the ‘getaddrinfo’ function.

Back to the top

DISCLAIMER

MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.

Back to the top


APPLIES TO
• Microsoft Windows 2000
• Microsoft Windows 2000 Server
• Microsoft Windows NT 4.0
• Microsoft Windows 98 Standard Edition
• Microsoft Windows 95
• Microsoft Visual Studio 2008 Professional Edition
• Microsoft Visual Studio 2008 Standard Edition
• Microsoft Visual Studio 2005 Professional Edition
• Microsoft Visual Studio 2005 Standard Edition
• Microsoft Visual Studio .NET 2003 Professional Edition
• Microsoft Visual Studio .NET 2003 Academic Edition

Back to the top

Keywords: 
kbnomt kbrapidpub KB955045

Back to the top

 

Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
Microsoft Corporation. All rights reserved. Terms of Use | Trademarks


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply

*
To prove that you're not a bot, enter this code
Anti-Spam Image