Nick Nick - 1 year ago 232
C++ Question

Winsock2.h vs winsock2.h and wsock32.lib vs ws2_32.lib

I am confused about couple of things about winsock.

First, what the difference between including Winsock2.h vs winsock2.h (caps of 'w')

Second, what is the difference between linking with wsock32.lib with ws2_32.lib?

I have tried couple of combinations and they result in compile time errors. Can anyone explain me the logical reasoning behind what to use?


Answer Source

There is no difference between Winsock2.h and winsock2.h. Filenames are case-insensitive on typical Windows filesystems. The ws2_32.lib file is for Winsock 2, while wsock32.lib is for the obsolete, older version.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download