error LNK2001: unresolved external symbol __imp__inet_ntoa@4问题解决

开发环境:VC 6.0 

出现错误描述

--------------------Configuration: SocketClient - Win32 Debug--------------------
Linking...
SocketClient.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4
SocketClient.obj : error LNK2001: unresolved external symbol __imp__recvfrom@24
SocketClient.obj : error LNK2001: unresolved external symbol __imp__WSAJoinLeaf@32
SocketClient.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4
SocketClient.obj : error LNK2001: unresolved external symbol __imp__closesocket@4
SocketClient.obj : error LNK2001: unresolved external symbol __imp__bind@12
SocketClient.obj : error LNK2001: unresolved external symbol __imp__htons@4
SocketClient.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0
SocketClient.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
SocketClient.obj : error LNK2001: unresolved external symbol __imp__WSASocketA@24
SocketClient.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8
Debug/SocketClient.exe : fatal error LNK1120: 11 unresolved externals
Error executing link.exe.

SocketClient.exe - 12 error(s), 0 warning(s)

解决:

1.加入头文件:

#include <Winsock2.h>

2.菜单栏------>Project------>Settings------>Link标签页------>Object/library modules------>加入ws2_32.lib------>重新编译连接------>解决。


你可能感兴趣的:(error LNK2001: unresolved external symbol __imp__inet_ntoa@4问题解决)