[Winpcap-users] error C2065: 'PCAP_SRC_IF_STRING' : undeclared
identifier
Craig Bumpstead
cbumpste at yahoo.com.au
Sat Jan 14 03:06:22 GMT 2006
Hi,
I have the following error:
error C2065: 'PCAP_SRC_IF_STRING' : undeclared
identifier
Thank you to Gianluca Varenni for his suggestion, but
I think I should stay with VC++ 2003 as most seem to
use it rather than 2005.
The code is the sample from the doc's, just modified
slightly.
I have put the relevant paths to the includes and lib
directories in VC++ and included pcap.h in form1.h.
What am I missing?
I have put the following code in the form_load area.
#undef MessageBox
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_ex(PCAP_SRC_IF_STRING, NULL
/* auth is not needed */, &alldevs, errbuf) == -1)
{
MessageBox::Show(S"Error in pcap_findalldevs_ex");
//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);
++i;
if (d->description)
{
String *myString;
myString = d->description;
cboListInterfaces->Items->Add(myString);
/*printf(" (%s)\n", d->description);*/
}
else
{
/*printf(" (No description
available)\n");*/
MessageBox::Show(S"No description
available",S"Error");
}
}
if (i == 0)
{
MessageBox::Show(S"No interfaces found! Make sure
WinPcap is installed.",S"Error");
//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);
}
Cheers,
Craig
____________________________________________________
Do you Yahoo!?
Listen to over 20 online radio stations and watch the latest music videos on Yahoo! Music.
http://au.launch.yahoo.com
More information about the Winpcap-users
mailing list