English 中文(简体)
Statically linking Winsock?
原标题:

I m using Winsock 1.1 in my project. I include wsock32.lib in "Additional Dependencies".

I m looking at the DLL project using depends.exe and notice that the DLL depends on wsock32.dll. How can I statically link it so that it doesn t depend on wsock32.dll?

问题回答

The short answer is that you can t. There is no static winsock library, you can only invoke wsock32.dll. Much the same way that you can t statically link to user32 or kernel32. There are things with wsock32.dll internally that are necessarily different on different versions of Windows, and even different service packs on the same versions of Windows, so statically linking would be a bit of a nightmare.

wsock32.dll is present on all versions of Windows that have TCP/IP installed, though, with the same interface, so there wouldn t be any benefit from statically linking anyway.





相关问题
how to reliable capture display setting changed

static void Main() { // Set the SystemEvents class to receive event notification when a user // when display settings change. SystemEvents.DisplaySettingsChanged += new ...

Why use CComBSTR instead of just passing a WCHAR*?

I m new to COM. What exactly is the advantage of replacing: L"String" with CComBSTR(L"String") I can see a changelist in the COM part of my .NET application where all strings are replaced in this ...

COM Basic links

folks can you provide me the tutorial link or .pdf for learning basic COM?. i do google it.. still i recommend answers of stackoverflow so please pass me.. Thanks

Statically linking Winsock?

I m using Winsock 1.1 in my project. I include wsock32.lib in "Additional Dependencies". I m looking at the DLL project using depends.exe and notice that the DLL depends on wsock32.dll. How can I ...

热门标签