0

Hi guys
I am using VC++ on windows xp. When I compile the following code no errors; no warning; well but when I run it there are three errors code:

void main()
{
pcap_if_t *alldevs;
pcap_if_t *d;
int i=0;
char errbuf[PCAP_ERRBUF_SIZE];


/* Retrieve the device list from the local machine */
if (pcap_findalldevs(&alldevs, errbuf) == -1)
{
fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf);
exit(1);
}


/* Print the list */
for(d= alldevs; d != NULL; d= d->next)
{
printf("%d. %s", ++i, d->name);
if (d->description)
printf(" (%s)\n", d->description);
else
printf(" (No description available)\n");
}


if (i == 0)
{
printf("\nNo interfaces found! Make sure WinPcap is installed.\n");
return;
}    /* We don't need any more the device list. Free it */
pcap_freealldevs(alldevs);}when I try to build its executable file the following errors were generated:--------------------Configuration: test1 - Win32 Debug--------------------
Compiling...
test1.cpp
Linking...
test1.obj : error LNK2001: unresolved external symbol _pcap_freealldevs
test1.obj : error LNK2001: unresolved external symbol _pcap_findalldevs
Debug/test1.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.test1.exe - 3 error(s), 0 warning(s)

What should I do with this?Thanks in advance

Edited by happygeek: fixed formatting

2
Contributors
1
Reply
3
Views
10 Years
Discussion Span
Last Post by d.xue.newcastle
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.