문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top