2

I wanna set up a socket on a windows machine. For compilation I am using cygwin with the g++ compiler. For setting up a socket I would need the following library:

WS2_32.lib

which cannot be found on my machine. Is this part of MS SDK or can I download it for free from the web somewhere? If not, is there another way to setup a Socket without winsock.h on Windows?

4 Answers 4

3

Download from the Platform SDK:

Windows® Server 2003 SP1 Platform SDK

or

Windows SDK for Windows Server 2008 and .NET Framework 3.5

Sign up to request clarification or add additional context in comments.

Comments

2

If you want to use native Windows sockets, switch to MinGW which is a native Windows C and C++ compiler and comes with all the required libraries.

Comments

1

For Socket programming, Qt provides a high level library and under L/GPL license.

Comments

1

You are looking for Beej's Guide to Network Programming: http://www.beej.us/guide/bgnet/

BTW: I am pretty sure MinGW does contain this lib (or something compatible). Are you having problems in linking? This should work "out of the box"

1 Comment

He's using cygwin, not MinGW.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.