I am using MinGW compiler on Windows to compile my C++ application with sockets. My command for linking looks like:
g++.exe -Wall -Wno-long-long -pedantic -l
with mingw on eclipse: Menu - Projekt - Properties - c/c++Build - Settings: Register "Tool Settings" - MinGW C Linker - Miscellaneous: Lower Part "other objects" add: "D:\Programmierung\mingw\lib\libwsock32.a" for example. No other entries for libwsock32.a on any other properties required, especially not in Library-entries. Also no flags relating to this Lib.