Isn't that a problem like here?
http://programmingrants.blogspot.com/2009/09/tips-on-undefined-reference-to.html
Basically, don't forget to establish a connection with Ws2_32.lib (a message from the linker, so this should be the reason), but you seem to be doing it already.
... if you are working with an old version of Windows software, say you have a version higher than XP by placing #define _WIN32_WINNT 0x0501 before including the headers (it is unlikely to be necessary now, but it may be).
These may be other simple problems. The usual (Unix) convention for libraries is to add them to lib. In the future, the value for -lWS32_32 will consist in finding a file named libWS32_32.a . He probably does not find it because he lacks the path to the directory containing the library. You can add -L followed by the path to the correct directory. In addition, you donβt even need to -l contact the library, just putting the full path into the library (in this case, the real file name as it appears in the file system) should also work.
The problem may also be related to paths. For example, problems may occur if the library path contains spaces. If so, you can try placing the library files in a directory with a simpler name.
Please use some feedback about your actual configuration (which contains the library file) and what you actually tried. You can also try setting the LIBS and LIBPATH environment variables (the simplest way is probably to do this from a makefile).
kriss
source share