I'm using MS Visual 2010 and I've created a static library (.lib). Now, my library uses #include <winsock2.h> in one of the header (.hpp) files. This means that I need to link ws2_32.lib when I compile.
Unfortunately, I can't figure out how to link ws_32.lib to my project when the configuration is set to "Static Library". As a result, I need to link both my .lib file and ws2_32.lib in any projects that use my static library as seen below:
This is an acceptable temporary solution, however I'd like to somehow link ws_32.lib in my library so that a user does not need to link to both libraries on their side. Does anyone know how to do this?
I've gone through this. Most people just say, "Just do what works here" because doing otherwise is simply a hassle. In reality, copying stub symbols from ws2_32.lib into your library is inefficient anyways.
You should be aware that doing that has legal implications when it comes to distributing your codebinary libraries. Since you are linking against a library everyone with a Windows machine has, it seems to me that you are spending too much time worrying about it... IMHO.