Winsocks Compatability issues
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!
精彩评论