问题描述
我对一些关于winsock的事情感到困惑。
首先,包含Winsock2.h和winsock2.h(w的上限) / p>
第二,使用ws2_32.lib连接wsock32.lib和有什么区别?
的组合,并导致编译时错误。
感谢
Nick
Winsock2.h
和 winsock2.h
之间没有区别。文件名在典型的Windows文件系统上不区分大小写。 ws2_32.lib
文件用于Winsock 2, wsock32.lib
用于过时的旧版本。 p>
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?
ThanksNick
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.
这篇关于Winsock2.h对winsock2.h和wsock32.lib对ws2_32.lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!