Boost Asio dll 在 Windows 2000 上引发 ws2_32.dll 错误
我有一个使用 boost Asio 进行网络连接的 dll。 当我将此 dll 链接到在 Windows 2000 上运行的应用程序时,会引发运行时异常:
“无法在动态链接库 WS2_32.dll 中找到过程入口点 freeaddrinfo”
Microsoft 在 http://msdn.microsoft.com/en-us/library/ms737931(VS. 85).aspx,但这对我不起作用。
谁能指出我的解决方案吗?
非常感谢,
--维杰
I have a dll that uses boost Asio for networking. When I link this dll to an application running on Windows 2000, a runtime exception is thrown:
"The procedure entry point freeaddrinfo could not be located in the dynamic link library WS2_32.dll"
Microsoft provides a workaround at http://msdn.microsoft.com/en-us/library/ms737931(VS.85).aspx, but that did not work for me.
Can anyone point me to a solution??
Thanks a lot,
-- Vijay
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否使用为
NTDDI_VERSION
和_WIN32_WINNT
设置的正确值构建 dll 以面向 Windows 2000? 您希望将它们设置为 0x05000000 和 0x0500。 假设您完全重建了 dll,那么您应该会收到有关编译器无法找到 freeaddrinfo 的警告(如果您没有遵循 MS 解决方法),或者它应该“正常工作”。现在,我希望您正在构建以更高版本的 Windows 为目标,并且标头允许您使用您尝试运行的系统上存在的系统 dll 中不存在的函数。
Are you building your dll with the correct values set for
NTDDI_VERSION
and_WIN32_WINNT
to target the Windows 2000? You want them set to 0x05000000 and 0x0500. Assuming you then rebuild your dll completely you should then either get a warning about the compiler not being able to findfreeaddrinfo
(if you haven't followed the MS workaround) or it should 'just work'.Right now I expect you're building to target a later version of windows and the headers are allowing you to use the function which isn't present in the system dlls that are present on the system that you're trying to run on.