开发者

Winsocks Compatability issues

开发者 https://www.devze.com 2023-03-19 19:40 出处:网络
I have a executable that requires ws2_32.dll but requires WS2tcpip.h and only works on 开发者_开发知识库Windows 7, doesn\'t work on XP, haven\'t tried vista.

I have a executable that requires ws2_32.dll but requires WS2tcpip.h and only works on 开发者_开发知识库Windows 7, doesn't work on XP, haven't tried vista.

This is a serious issue, as you can't run the program without missing DLL files. How can I wrap it all up so I won't have any missing DLL issues? Or compatibility issues at all!


ws2_32.dll is on all Windows since...stone age Windows. If it is using some functions that are only on Windows 7 or Windows Vista, then you will have to recompile/port it back to Windows XP, so that it does not need it.


I think you should check the following article: link.

Update: you should do something like this where you inlcude Windows dependent headers:

// Windows XP
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#include <Windows.h>


I just used LoadLibrary and GetProcAddress to find the functions inside of ws2_32.dll, so your standard dynamic function linking. Simple!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号