错误 LNK2019 无法解析的外部符号 __imp_WSARecv,该符号在函数 "public: bool __cdecl CTCPByteSession::Receive(void)" (?Receive@CTCPByteSession@@QEAA_NXZ)
错误 LNK2019 无法解析的外部符号 __imp_socket,该符号在函数 "public: static int __cdecl CTCPConnector::ConnectTo(int,int,int,int,int)" (?ConnectTo@CTCPConnector@@SAHHHHHH@Z)
错误 LNK2019 无法解析的外部符号 __imp_setsockopt,该符号在函数 "public: static int __cdecl CTCPConnector::ConnectTo(int,int,int,int,int)" (?ConnectTo@CTCPConnector@@SAHHHHHH@Z)
错误 LNK2019 无法解析的外部符号 __imp_send,该符号在函数 "public: virtual int __cdecl CTCPByteSession::CTCPByteBackScroll::BackGo(class CByteBuffer &)" (?BackGo@CTCPByteBackScroll@CTCPByteSession@@UEAAHAEAVCByteBuffer@@@Z)
错误 LNK2019 无法解析的外部符号 __imp_inet_addr,该符号在函数 "public: bool __cdecl CBombClient::ConnectTo(char const *,int,int)" (?ConnectTo@CBombClient@@QEAA_NPEBDHH@Z)
错误 LNK2019 无法解析的外部符号 __imp_htons,该符号在函数 "public: bool __cdecl CTCPCompleteCenter::AttachSocket(int,int)" (?AttachSocket@CTCPCompleteCenter@@QEAA_NHH@Z)
解决方法:
头文件加上一句
#pragma comment(lib,"ws2_32.lib")