关于“无法定位程序输入点getaddrinfo于动态链接库WS32_32.dll上”的问题
2009-06-15 15:32
507 查看
今天收到一个bug,说我们的产品在windows 2000的操作环境下无法正常安装运行,安装后弹出“无法定位程序输入点getaddrinfo于动态链接库WS32_32.dll上”的错误。 简单地在网上搜了一下,发现多个讨论和解决方案。
方案一:http://hi.baidu.com/tjmd/blog/ITem/e35d0dd787b540dda144df98
该问题一般出现在用VC编译的程序在XP和2003上可以正常运行,2000下则报此错误,解决方法比较简单,分两种情况,一种是对于VC6或者VC6升级到VC8的工程,修改编译选项中的_WIN32_WINNT和WINVER为0x0500,另一种是直接用VC8创建的工程,StdAfx.h里面已经有了这两个变量的定义,所以需要替换所有StdAfx.h文件里面_WIN32_WINNT和WINVER两个宏的变量,修改其值为0x0500,再编译即可解决!
方案二:http://topic.csdn.net/u/20080429/11/6167d25d-8b3c-4e21-8629-3b981f439c35.html
使用静态连接
在编译开关里选择
方案三:http://topic.csdn.net/t/20060828/13/4980483.html
应该说直接拷贝DLL是解决不了问题的。Top
6 楼DentistryDoctor(不在无聊中无奈,就在沉默中变态)回复于 2006-08-28 13:24:07 得分 0
据我遇到的情况,是因为用到了getaddrinfo的的Unicode版本造成的(不管是直接还是间接),这个函数 (GetAddrInfoW),是Windows XP SP2才加上去的,低于XP SP2的版本是无法用这个函数的,拷贝DLL也是不行的。需要改代码,然后再重新编译。Top
7 楼lixiaosan(小三)回复于 2006-08-28 13:26:23 得分 50
http://support.microsoft.com/kb/822334/en-us href="http://topic.csdn.net/t/20060828/13/4980483.html" target=_blank>Top
8 楼DentistryDoctor(不在无聊中无奈,就在沉默中变态)回复于 2006-08-28 13:34:19 得分 50
是不是用到了GetAddrInfo,FreeAddrInfo,CSocketAddr这些XP才支持的东东,需要你检查代码了。
方案四:http://support.microsoft.com/kb/822334/en-us
To resolve this problem, follow these steps:
Copy the Atlsocket.h file to any directory that you want to use. This file is located in the following directory:
Program Files/Microsoft Visual Studio .NET 2003/Vc7/atlmfc/include
Add the following block of code to the copy of the Atlsocket.h file that you created in step 1.
Start Microsoft Visual C++.
On the Tools menu, click Options. In the left pane of the Options dialog box, expand Projects, and then click VC++ Directories.
Note If you are using Visual C++ Express Edition, expand Projects and Solutions in the left pane of the Options dialog box, and then click VC++ Directories.
Under Show directories for, click Include files. Then, add the directory where the modified version of the Atlsocket.h file is located to the top of the list.
Rebuild you application
但是我们代码没有使用 StdAfx.h并且已经是静态链接也不是一个ATL工程也就不能引用ATLBase.h,最后综合上面的解决方案和意见,改出了自己的版本。
将原有的#pragma comment(lib, "ws2_32.lib")改为了
#pragma comment(lib, "ws2_32.lib")
//Start of Addition
#if _WIN32_WINNT < 0x0502
#define ADDRINFOT addrinfo
#define GetAddrInfo getaddrinfo
#define FreeAddrInfo freeaddrinfo
#endif
问题经测试已解决。
方案一:http://hi.baidu.com/tjmd/blog/ITem/e35d0dd787b540dda144df98
该问题一般出现在用VC编译的程序在XP和2003上可以正常运行,2000下则报此错误,解决方法比较简单,分两种情况,一种是对于VC6或者VC6升级到VC8的工程,修改编译选项中的_WIN32_WINNT和WINVER为0x0500,另一种是直接用VC8创建的工程,StdAfx.h里面已经有了这两个变量的定义,所以需要替换所有StdAfx.h文件里面_WIN32_WINNT和WINVER两个宏的变量,修改其值为0x0500,再编译即可解决!
方案二:http://topic.csdn.net/u/20080429/11/6167d25d-8b3c-4e21-8629-3b981f439c35.html
使用静态连接
在编译开关里选择
方案三:http://topic.csdn.net/t/20060828/13/4980483.html
应该说直接拷贝DLL是解决不了问题的。Top
6 楼DentistryDoctor(不在无聊中无奈,就在沉默中变态)回复于 2006-08-28 13:24:07 得分 0
据我遇到的情况,是因为用到了getaddrinfo的的Unicode版本造成的(不管是直接还是间接),这个函数 (GetAddrInfoW),是Windows XP SP2才加上去的,低于XP SP2的版本是无法用这个函数的,拷贝DLL也是不行的。需要改代码,然后再重新编译。Top
7 楼lixiaosan(小三)回复于 2006-08-28 13:26:23 得分 50
http://support.microsoft.com/kb/822334/en-us href="http://topic.csdn.net/t/20060828/13/4980483.html" target=_blank>Top
8 楼DentistryDoctor(不在无聊中无奈,就在沉默中变态)回复于 2006-08-28 13:34:19 得分 50
是不是用到了GetAddrInfo,FreeAddrInfo,CSocketAddr这些XP才支持的东东,需要你检查代码了。
方案四:http://support.microsoft.com/kb/822334/en-us
To resolve this problem, follow these steps:
Copy the Atlsocket.h file to any directory that you want to use. This file is located in the following directory:
Program Files/Microsoft Visual Studio .NET 2003/Vc7/atlmfc/include
Add the following block of code to the copy of the Atlsocket.h file that you created in step 1.
//Atlsocket.h #pragma comment(lib, "ws2_32.lib") #pragma comment(lib, "mswsock.lib") //Start of Addition #if _WIN32_WINNT < 0x0502 #define ADDRINFOT addrinfo #define GetAddrInfo getaddrinfo #define FreeAddrInfo freeaddrinfo #endif //End of Addition namespace ATL
Start Microsoft Visual C++.
On the Tools menu, click Options. In the left pane of the Options dialog box, expand Projects, and then click VC++ Directories.
Note If you are using Visual C++ Express Edition, expand Projects and Solutions in the left pane of the Options dialog box, and then click VC++ Directories.
Under Show directories for, click Include files. Then, add the directory where the modified version of the Atlsocket.h file is located to the top of the list.
Rebuild you application
但是我们代码没有使用 StdAfx.h并且已经是静态链接也不是一个ATL工程也就不能引用ATLBase.h,最后综合上面的解决方案和意见,改出了自己的版本。
将原有的#pragma comment(lib, "ws2_32.lib")改为了
#pragma comment(lib, "ws2_32.lib")
//Start of Addition
#if _WIN32_WINNT < 0x0502
#define ADDRINFOT addrinfo
#define GetAddrInfo getaddrinfo
#define FreeAddrInfo freeaddrinfo
#endif
问题经测试已解决。
相关文章推荐
- 关于“无法定位程序输入点getaddrinfo于动态链接库WS32_32.dll上”的问题
- 关于“无法定位程序输入点getaddrinfo于动态链接库WS32_32.dll上”的问题
- [提问]无法定位程序输入点_gmp_get_memory_functions于动太链接库libgmp-3.dll上?[已解决]
- Qt中关于无法定位程序输入点的一种问题解决方式
- [工具/PC]计算机中丢失libiconv-2.dll,丢失libintl-8.dll,无法定位程序输入点libiconv于动态链接库libiconv-2.dll上问题解决方法
- Win764bit上安装32位Oracle10g出现错误:无法定位程序输入点GetProcessImageFileNameW于动态链接库PSAPI.DLL
- 关于“无法找到入口——无法定位程序输入点......于动态链接库QtCore4.dll上”的解决方案
- 关于“无法定位程序输入点gzdirect于动态链接库zlib1.dll”的问题
- 解决 WinXP下 libcurl.dll 无法定位程序输入点GetTickCount64问题
- 无法定位程序输入点 inet_ntop 于动态链接库 WS2_32.dll上
- 关于用g++编译后运行时出现的问题:无法定位程序输入点__gxx_personality_v0
- 装MSN报错问题解决 无法定位程序输入点except handler4 common 于动态链接库nsvcrt.dll【转】
- QT程序发布的一个问题:无法定位程序输入点与动态链接库QtCore4.dll
- 解决“无法定位程序输入点ucrtbase.terminate于动态链接库api-ms-win-crt-runtime-|1-1-0.dll“问题
- 【OpenGL】无法定位程序输入点_glewInit@0于动态链接库glew32.dll
- 无法定位程序输入点_ZdaPvj于动态链接库libstdc++-6.dll上
- 关于"无法定位程序输入点 RtlUnhandledExceptionFilter 于动态链接库"解决方法
- opencv 无法定位程序输入点__gxx_personality_v0于动态链接库libstdc++-6.dll上
- 开机后显示无法定位程序输入点于动态链接上(定位程序输入点_except_handler4_common于动态链接msvcrt.dll上)
- 完美解决XP无法定位程序输入点RegGetValue于动态链接库ADVAPI32.dll,XP,win7注册表读取问题