Question

I am creating a chat application which I eventually want to use with my friends. Now I am using Winsock2 for the communication, but I have noticed that the lib file is dramatically increasing the bin size. Is there any way to use Winsock without statically linking it? The .dll file already contains all of the functions I need, so why do I still need the lib file?

UPDATE

Turns out it had something to do with the sqlite lib. For some reason it was increasing my bin size by 900 kb, I am gonna try and do it differently.

Was it helpful?

Solution

AFAIK there is no static winsock library. That means you're not incorporating the library's code by linking against the .lib, you're actually importing the functions exported by the dll and I believe this is exactly what you want.

Your file might increase in size slightly and that should only significantly matter in debug builds which have debugging symbols and a lot of other stuff to ease debugging.

Try with a release build and see if that shrinks down, perhaps other debugging information are bloating your executable.

OTHER TIPS

You can only do dynamic linking of Winsock2 library. Remember, with native every dll there is lib, to get export symbols. You are linking dynamically.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top