main.obj : error LNK2019: 无法解析的外部符号 _SendARP@16,该符号在函数 _main 中被引用
源码:
#pragma comment(lib,"Netapi32.lib")
#pragma comment(lib,"ws2_32.lib")
#include
#include
#include
#include
#include
#include
int __cdecl main()
{
HRESULT hr;
IPAddr ipAddr;
ULONG pulMac[2];
ULONG ulLen;
ipAddr=inet_addr("127.0.0.1");
memset(pulMac,0xff,sizeof(pulMac));
ulLen=6;
hr=SendARP(ipAddr,0,pulMac,&ulLen);
printf("Return %08x, length %8d\n",hr,ulLen);
size_t i,j;
char *szMac=new char[ulLen*3];
PBYTE pbHeMac=(PBYTE)pulMac;
for(i=0,j=0;i
j+=sprintf(szMac+j,"%02X:",pbHeMac[i]);
}
sprintf(szMac+j,"%02X:",pbHeMac[i]);
printf("MAC address %s\n",szMac);
delete []szMac;
return 0;
}
请问高手如何解决