wincap4.11在vc6下编译出现_W64错误

别人问题以及解答: winpcap 4.1.1在vc6下编译会出现以下错误,原因是vc6.0并不完美支持c++99标准,在64位cpu中编译会有问题,将winpcap开发包换到4.0.1版本及以下错误消失 c:\wpdpack\include\pcap-stdinc.h(79) : error C2144: syntax error : missing ';' before type 'unsigned int' c:\wpdpack\include\pcap-stdinc.h(79) : fatal error C1004: unexpected end of file found 在一个就是用升级VC6.0 PSDK的方法估计也可以解决。 自己解决方法: leo解决方法: 但是两种方法我都嫌麻烦(这是VS等软件各种版本引起的各种错误,烦死....) 既然是VC6的PSDK版本低,不支持W64,那好!我用VS2008,这样总可以了吧,可以跟进高版本的WinCap了吧。结果我是对的。 还是按原来http://hi.baidu.com/benboy2/blog/item/193085fa441cc69d58ee906d.html说讲的的配置好了-->把文件夹WpdPack放到工程目录,什么option中的setting(include和lib)搞好,工程右击->属性->预处理器加上WPCAP;HAVE_REMOTE,又->linker->Input加上wpcap.lib就Ok 配置好了。 如下一简单例子leo编译通过,大家可以试试: // WinCapTest2008.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "pcap.h"//leo开始把这句定义在#include"sdafx.h"之前,结果引起22个错误,换过就编译通过了 int _tmain(int argc, _TCHAR* argv[]) { pcap_if_t *alldevs; pcap_if_t *d; int i=0; char errbuf[PCAP_ERRBUF_SIZE]; if (pcap_findalldevs(&alldevs, errbuf) == -1) { fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf); exit(1); } 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 -1; } pcap_freealldevs(alldevs); return 0; }
原文地址:https://www.cnblogs.com/growup/p/1971540.html