C, Microsoft Windows

How to link winsock library in Eclipse CDT

1.Right click on project’s name to open its Properties or hit Alt+Enter.
2. Expand C/C++ Build on the tree.
3. Select Settings.
4. Open Tool Settings Tab.
5. Select Libraries under Cross GCC Linker.
6. Add a new entry ws_32 in the right top section (Libraries (-l)).
7. In your project’s source now, add these lines:

#include <winsock2.h>
#include <windows.h>