MinGW linker error: winsock

Put the -lws2_32 AFTER the list of object files – GCC searches libraries and object files in the order they appear on the command line.

Just to help the other viewers out there:

gcc hello.c -o hello.o -lws2_32

Leave a Comment