分类: C/C++
2008-03-03 13:40:09
--------------------Configuration: csgptest - Win32 Debug--------------------
Linking...
CSGPAPI.lib(csgpapi.obj) : error LNK2001: unresolved external symbol _htons@4
CSGPAPI.lib(csgpapi_internal.obj) : error LNK2001: unresolved external symbol _htons@4
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _htons@4
CSGPAPI.lib(csgpapi_internal.obj) : error LNK2001: unresolved external symbol _ntohs@4
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _ntohs@4
CSGPAPI.lib(ls_link.obj) : error LNK2001: unresolved external symbol _ntohs@4
CSGPAPI.lib(csgpapi_internal.obj) : error LNK2001: unresolved external symbol _htonl@4
CSGPAPI.lib(csgpapi_internal.obj) : error LNK2001: unresolved external symbol _ntohl@4
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _select@20
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _WSAStartup@8
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _WSACleanup@0
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _gethostbyname@4
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _inet_addr@4
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _getservbyname@8
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _listen@8
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _bind@12
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _setsockopt@20
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _socket@12
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _getprotobyname@4
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _closesocket@4
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _connect@12
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _inet_ntoa@4
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _accept@12
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _send@16
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _recv@16
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _gethostname@8
CSGPAPI.lib(ls_socks.obj) : error LNK2001: unresolved external symbol _getpeername@12
Debug/csgptest.exe : fatal error LNK1120: 23 unresolved externals
执行 link.exe 时出错.
看错误是lib没有链接,在代码中添上这句试试:
#pragma comment(lib, "Ws2_32.lib")