C++中ws2 32.lib的用法与作用
请问我用vs10编写c++程序,导入这个ws2_32.lib类库报错,请问一下,这个ws_2_32.lib这个类库是微软写的吗?#pragmacomment(lib,"w...
请问我用vs10编写c++程序,导入这个 ws2_32.lib类库报错,
请问一下,这个ws_2_32.lib 这个类库是微软写的吗?
#pragma comment(lib,"ws_2_32.lib")
error LNK1104:无法打开文件"ws_2_32.lib"。
备注:
本人c++新手,不知道怎么用,现在要写网络通讯 展开
请问一下,这个ws_2_32.lib 这个类库是微软写的吗?
#pragma comment(lib,"ws_2_32.lib")
error LNK1104:无法打开文件"ws_2_32.lib"。
备注:
本人c++新手,不知道怎么用,现在要写网络通讯 展开
1个回答
展开全部
#pragma comment(lib,"ws_2_32.lib") 应该为
#pragma comment( lib, "ws2_32.lib")
该库对应ws2_32.dll,提供了对以下网络相关API的支持,若使用其中的API,则应该将ws2_32.lib加入工程(否则需要动态载入ws2_32.dll)。
accept
bind
closesocket
connect
getpeername
getsockname
getsockopt
htonl
htons
ioctlsocket
inet_addr
inet_ntoa
listen
ntohl
ntohs
recv
recvfrom
select
send
sendto
setsockopt
shutdown
socket
GetAddrInfoW
GetNameInfoW
WSApSetPostRoutine
FreeAddrInfoW
WPUCompleteOverlappedRequest
WSAAccept
WSAAddressToStringA
WSAAddressToStringW
WSACloseEvent
WSAConnect
WSACreateEvent
WSADuplicateSocketA
WSADuplicateSocketW
WSAEnumNameSpaceProvidersA
WSAEnumNameSpaceProvidersW
WSAEnumNetworkEvents
WSAEnumProtocolsA
WSAEnumProtocolsW
WSAEventSelect
WSAGetOverlappedResult
WSAGetQOSByName
WSAGetServiceClassInfoA
WSAGetServiceClassInfoW
WSAGetServiceClassNameByClassIdA
WSAGetServiceClassNameByClassIdW
WSAHtonl
WSAHtons
gethostbyaddr
gethostbyname
getprotobyname
getprotobynumber
getservbyname
getservbyport
gethostname
WSAInstallServiceClassA
WSAInstallServiceClassW
WSAIoctl
WSAJoinLeaf
WSALookupServiceBeginA
WSALookupServiceBeginW
WSALookupServiceEnd
WSALookupServiceNextA
WSALookupServiceNextW
WSANSPIoctl
WSANtohl
WSANtohs
WSAProviderConfigChange
WSARecv
WSARecvDisconnect
WSARecvFrom
WSARemoveServiceClass
WSAResetEvent
WSASend
WSASendDisconnect
WSASendTo
WSASetEvent
WSASetServiceA
WSASetServiceW
WSASocketA
WSASocketW
WSAStringToAddressA
WSAStringToAddressW
WSAWaitForMultipleEvents
WSCDeinstallProvider
WSCEnableNSProvider
WSCEnumProtocols
WSCGetProviderPath
WSCInstallNameSpace
WSCInstallProvider
WSCUnInstallNameSpace
WSCUpdateProvider
WSCWriteNameSpaceOrder
WSCWriteProviderOrder
freeaddrinfo
getaddrinfo
getnameinfo
WSAAsyncSelect
WSAAsyncGetHostByAddr
WSAAsyncGetHostByName
WSAAsyncGetProtoByNumber
WSAAsyncGetProtoByName
WSAAsyncGetServByPort
WSAAsyncGetServByName
WSACancelAsyncRequest
WSASetBlockingHook
WSAUnhookBlockingHook
WSAGetLastError
WSASetLastError
WSACancelBlockingCall
WSAIsBlocking
WSAStartup
WSACleanup
__WSAFDIsSet
WEP
#pragma comment( lib, "ws2_32.lib")
该库对应ws2_32.dll,提供了对以下网络相关API的支持,若使用其中的API,则应该将ws2_32.lib加入工程(否则需要动态载入ws2_32.dll)。
accept
bind
closesocket
connect
getpeername
getsockname
getsockopt
htonl
htons
ioctlsocket
inet_addr
inet_ntoa
listen
ntohl
ntohs
recv
recvfrom
select
send
sendto
setsockopt
shutdown
socket
GetAddrInfoW
GetNameInfoW
WSApSetPostRoutine
FreeAddrInfoW
WPUCompleteOverlappedRequest
WSAAccept
WSAAddressToStringA
WSAAddressToStringW
WSACloseEvent
WSAConnect
WSACreateEvent
WSADuplicateSocketA
WSADuplicateSocketW
WSAEnumNameSpaceProvidersA
WSAEnumNameSpaceProvidersW
WSAEnumNetworkEvents
WSAEnumProtocolsA
WSAEnumProtocolsW
WSAEventSelect
WSAGetOverlappedResult
WSAGetQOSByName
WSAGetServiceClassInfoA
WSAGetServiceClassInfoW
WSAGetServiceClassNameByClassIdA
WSAGetServiceClassNameByClassIdW
WSAHtonl
WSAHtons
gethostbyaddr
gethostbyname
getprotobyname
getprotobynumber
getservbyname
getservbyport
gethostname
WSAInstallServiceClassA
WSAInstallServiceClassW
WSAIoctl
WSAJoinLeaf
WSALookupServiceBeginA
WSALookupServiceBeginW
WSALookupServiceEnd
WSALookupServiceNextA
WSALookupServiceNextW
WSANSPIoctl
WSANtohl
WSANtohs
WSAProviderConfigChange
WSARecv
WSARecvDisconnect
WSARecvFrom
WSARemoveServiceClass
WSAResetEvent
WSASend
WSASendDisconnect
WSASendTo
WSASetEvent
WSASetServiceA
WSASetServiceW
WSASocketA
WSASocketW
WSAStringToAddressA
WSAStringToAddressW
WSAWaitForMultipleEvents
WSCDeinstallProvider
WSCEnableNSProvider
WSCEnumProtocols
WSCGetProviderPath
WSCInstallNameSpace
WSCInstallProvider
WSCUnInstallNameSpace
WSCUpdateProvider
WSCWriteNameSpaceOrder
WSCWriteProviderOrder
freeaddrinfo
getaddrinfo
getnameinfo
WSAAsyncSelect
WSAAsyncGetHostByAddr
WSAAsyncGetHostByName
WSAAsyncGetProtoByNumber
WSAAsyncGetProtoByName
WSAAsyncGetServByPort
WSAAsyncGetServByName
WSACancelAsyncRequest
WSASetBlockingHook
WSAUnhookBlockingHook
WSAGetLastError
WSASetLastError
WSACancelBlockingCall
WSAIsBlocking
WSAStartup
WSACleanup
__WSAFDIsSet
WEP
追问
不好意思,这个答案我刚才看过了, 想了解一下详情。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |