关于“无法定位程序输入点getaddrinfo于动态链接库WS32_32.dll上”的问题
来源:互联网 发布:海关数据免费查询 编辑:程序博客网 时间:2024/05/01 09:52
文章来源:http://blog.csdn.net/k1988/article/details/4270580
今天收到一个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-usTop
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, expandProjects, 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 clickVC++ 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上”的问题
- 解决Windows2000下“无法定位程序输入点getaddrinfo于动态链接库ws2_32.dll上”的问题
- 关于无法定位程序输入点_glutInitWithExit于动态链接库glut32.dll上的解决方法
- 无法定位程序输入点ldrlockloaderlock于动态链接库ntdll.dll上的解决办法
- 解决“无法定位程序输入点于动态链接库XX.DLL上”的方法
- 无法定位程序输入点_glutInitWithExit于动态链接库glut32.dll上的解决方法
- 无法定位程序输入点 于动态链接库上
- 无法定位程序输入点 LdrSetSessionName 于动态链接库 mfc40u.dll 上
- 无法定位程序输入点_Z5qFreePv于动态链接库QtCore4.dll上
- 无法定位程序输入点mysql_stmt_row_tell于动态链接库LIBMYSQL.DLL上
- 无法定位程序输入点_except_handler4_common于动态链接库msvcvt.dll上
- 无法定位程序输入点***于动态链接库fmod.dll上
- 无法定位程序输入点...于动态链接库 msvcrt.dll上
- OWB无法定位程序输入点kpuhhalo于动态链接库oci.dll上
- 解决无法定位程序输入点 _Z17qt_message_output9QtMsgTypePKc 于动态链接QtCore4.dll库上
- itunes无法定位程序输入点sqlite3-wal-checkpoint于动态链接库sqlite3.dll上。
- ctfmon.exe 无法定位程序输入点 TF_InvalidAssemblyListCache 于动态链接库 MSCTF.dll上
- SimpleAdapter代码学习bindView
- 7月15号面试题总结
- Hibernate的一二级缓存:一级缓存
- android 之 ActivityManager
- Please update ADT to the latest version.
- 关于“无法定位程序输入点getaddrinfo于动态链接库WS32_32.dll上”的问题
- 自定义系统命令缩写
- android中Touch事件的处理逻辑
- 腾讯QQ域名的故事
- HDU 2066 一个人的旅行
- 哈夫曼树
- ios 自制放大镜效果demo
- 高速PCB 设计新手入门及进阶教程
- 飞思卡尔单片机DZ60---TPM1输出比较