简体   繁体   中英

C++ Socket programming Windows

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?

如果要使用本机Windows套接字,请切换到MinGW ,它是本机Windows C和C ++编译器,并附带所有必需的库。

对于Socket编程, Qt提供了一个高级库,并具有L / GPL许可。

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM