请教一个有关WINSOCK.DLL的问题~~~
我要用winsock编写一个通信组件(不用MFC),所以包含头文件<winsock.h>,但调用winsock函数时出现连接错误:(在VC6和VC7中都出现同样错误)
------ 已启动生成:项目:ComModule, 配置:Debug Win32 ------
正在编译...
TCPImplement.cpp
正在链接...
正在创建库 Debug/ComModule.lib 和对象 Debug/ComModule.exp
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _WSACleanup@0 ,该符号在函数 "public: virtual __thiscall CTCPImplement::~CTCPImplement(void)" (??1CTCPImplement@@UAE@XZ) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _WSAStartup@8 ,该符号在函数 "protected: int __thiscall CTCPImplement::StartupSocket(void)" (?StartupSocket@CTCPImplement@@IAEHXZ) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _socket@12 ,该符号在函数 "protected: bool __thiscall CTCPImplement::CreateSocket(void)" (?CreateSocket@CTCPImplement@@IAE_NXZ) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _connect@12 ,该符号在函数 "protected: bool __thiscall CTCPImplement::ConnectSocket(void)" (?ConnectSocket@CTCPImplement@@IAE_NXZ) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _htons@4 ,该符号在函数 "protected: bool __thiscall CTCPImplement::ConnectSocket(void)" (?ConnectSocket@CTCPImplement@@IAE_NXZ) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _WSASetLastError@4 ,该符号在函数 "protected: bool __thiscall CTCPImplement::ConnectSocket(void)" (?ConnectSocket@CTCPImplement@@IAE_NXZ) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _gethostbyname@4 ,该符号在函数 "protected: bool __thiscall CTCPImplement::ConnectSocket(void)" (?ConnectSocket@CTCPImplement@@IAE_NXZ) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _inet_addr@4 ,该符号在函数 "protected: bool __thiscall CTCPImplement::ConnectSocket(void)" (?ConnectSocket@CTCPImplement@@IAE_NXZ) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _closesocket@4 ,该符号在函数 "protected: bool __thiscall CTCPImplement::CloseSocket(void)" (?CloseSocket@CTCPImplement@@IAE_NXZ) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _WSACancelBlockingCall@0 ,该符号在函数 "protected: bool __thiscall CTCPImplement::CloseSocket(void)" (?CloseSocket@CTCPImplement@@IAE_NXZ) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _WSAIsBlocking@0 ,该符号在函数 "protected: bool __thiscall CTCPImplement::CloseSocket(void)" (?CloseSocket@CTCPImplement@@IAE_NXZ) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 "protected: void __thiscall ACommImplement::FireError(long)" (?FireError@ACommImplement@@IAEXJ@Z) ,该符号在函数 "public: virtual int __thiscall CTCPImplement::Send(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?Send@CTCPImplement@@UAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _WSAGetLastError@0 ,该符号在函数 "public: virtual int __thiscall CTCPImplement::Send(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?Send@CTCPImplement@@UAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _send@16 ,该符号在函数 "public: virtual int __thiscall CTCPImplement::Send(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?Send@CTCPImplement@@UAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 "protected: void __thiscall ACommImplement::FireIODataArrive(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?FireIODataArrive@ACommImplement@@IAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) ,该符号在函数 "public: virtual int __thiscall CTCPImplement::Receive(int)" (?Receive@CTCPImplement@@UAEHH@Z) 中被引用
TCPImplement.obj : error LNK2019: 无法解析的外部符号 _recv@16 ,该符号在函数 "public: virtual int __thiscall CTCPImplement::Receive(int)" (?Receive@CTCPImplement@@UAEHH@Z) 中被引用
Debug/ComModule.dll : fatal error LNK1120: 16 个无法解析的外部命令
生成日志保存在“file://d:\MyProject\MyWork\ComModule\Debug\BuildLog.htm”中
ComModule - 17 错误,0 警告
---------------------- 完成 ---------------------
生成:0 已成功, 1 已失败, 0 已跳过