project->settings->link 在object/library modules 中加入ws2_32.lib
在项目上点右键->属性->配置属性->链接器->输入->附加依赖项加入ws2_32.lib
如:
error LNK2001: unresolved external symbol __imp__send@16
tcpclient.obj : error LNK2001: unresolved external symbol __imp__closesocket@4
tcpclient.obj : error LNK2001: unresolved external symbol __imp__connect@12
tcpclient.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4
tcpclient.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4
tcpclient.obj : error LNK2001: unresolved external symbol __imp__htons@4
tcpclient.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0
tcpclient.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
tcpclient.obj : error LNK2001: unresolved external symbol __imp__socket@12
tcpclient.obj : error LNK2001: unresol
在项目上点右键->属性->配置属性->链接器->输入->附加依赖项加入ws2_32.lib
如:
error LNK2001: unresolved external symbol __imp__send@16
tcpclient.obj : error LNK2001: unresolved external symbol __imp__closesocket@4
tcpclient.obj : error LNK2001: unresolved external symbol __imp__connect@12
tcpclient.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4
tcpclient.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4
tcpclient.obj : error LNK2001: unresolved external symbol __imp__htons@4
tcpclient.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0
tcpclient.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
tcpclient.obj : error LNK2001: unresolved external symbol __imp__socket@12
tcpclient.obj : error LNK2001: unresol