I\'ve just started learning winsock through the \"Beej\'s guide to network programming\" book. I\'m programming under windows and running it through gcc. This is just a star
Beware! Your includes are wrong. The problem is that windows.h already includes winsock.h and winsock2.h then re-defines some structures and functions resulting in huge number of compilation errors. Move the windows.h include below the winsock2.h include, or just remove the windows.h include altogether, winsock2.h includes windows.h.