首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

求教!关于error LNK2019有关问题

2012-09-29 
求教!关于error LNK2019问题EVC socket通讯,事件模式监听;winsock2.h,ws2_32.lib文件也正确引用如下:出现

求教!关于error LNK2019问题
EVC socket通讯,事件模式监听;winsock2.h,ws2_32.lib文件也正确引用如下:



出现的错误:

SocketConnection.obj : error LNK2019: unresolved external symbol connect referenced in function "public: bool __cdecl SocketConnection::initSocketConnection(char,unsigned short)" (?initSocketConnection@SocketConnection@@QAA_NDG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol inet_addr referenced in function "public: bool __cdecl SocketConnection::initSocketConnection(char,unsigned short)" (?initSocketConnection@SocketConnection@@QAA_NDG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol htons referenced in function "public: bool __cdecl SocketConnection::initSocketConnection(char,unsigned short)" (?initSocketConnection@SocketConnection@@QAA_NDG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol socket referenced in function "public: bool __cdecl SocketConnection::initSocketConnection(char,unsigned short)" (?initSocketConnection@SocketConnection@@QAA_NDG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol WSAStartup referenced in function "public: bool __cdecl SocketConnection::initSocketConnection(char,unsigned short)" (?initSocketConnection@SocketConnection@@QAA_NDG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol recv referenced in function "public: unsigned char __cdecl SocketConnection::recvData(char,unsigned short)" (?recvData@SocketConnection@@QAAEDG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol send referenced in function "public: int __cdecl SocketConnection::sendData(char,unsigned short,char const *,int)" (?sendData@SocketConnection@@QAAHDGPBDH@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol WSAEventSelect referenced in function "public: bool __cdecl SocketConnection::createServerListen(unsigned short)" (?createServerListen@SocketConnection@@QAA_NG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol WSACreateEvent referenced in function "public: bool __cdecl SocketConnection::createServerListen(unsigned short)" (?createServerListen@SocketConnection@@QAA_NG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol listen referenced in function "public: bool __cdecl SocketConnection::createServerListen(unsigned short)" (?createServerListen@SocketConnection@@QAA_NG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol bind referenced in function "public: bool __cdecl SocketConnection::createServerListen(unsigned short)" (?createServerListen@SocketConnection@@QAA_NG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol htonl referenced in function "public: bool __cdecl SocketConnection::createServerListen(unsigned short)" (?createServerListen@SocketConnection@@QAA_NG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol ioctlsocket referenced in function "public: bool __cdecl SocketConnection::createServerListen(unsigned short)" (?createServerListen@SocketConnection@@QAA_NG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol closesocket referenced in function "public: void __cdecl SocketConnection::ServerListenDo(unsigned short)" (?ServerListenDo@SocketConnection@@QAAXG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol WSAEnumNetworkEvents referenced in function "public: void __cdecl SocketConnection::ServerListenDo(unsigned short)" (?ServerListenDo@SocketConnection@@QAAXG@Z)
SocketConnection.obj : error LNK2019: unresolved external symbol WSAWaitForMultipleEvents referenced in function "public: void __cdecl SocketConnection::ServerListenDo(unsigned short)" (?ServerListenDo@SocketConnection@@QAAXG@Z)
ARMV4IDbg/EarthQuake.exe : fatal error LNK1120: 16 unresolved externals

我将winsock2.h,ws2_32.lib放到stdafx.h中也不行、请高手指教!谢谢

------解决方案--------------------


可能性:
1.缺少lib
2.函数声明和实现是否一一对应
[解决办法]
缺少对应的lib文件

热点排行