known
known

Reputation: 189

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?

Upvotes: 1

Views: 2026

Answers (1)

Gerald
Gerald

Reputation: 23499

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.

Upvotes: 4

Related Questions