首页 > 代码库 > winpcap示例程序采用VC6编译时出错error C2054: expected '(' to follow '_W64'
winpcap示例程序采用VC6编译时出错error C2054: expected '(' to follow '_W64'
e:\vehiclesecurity\wpdpack_4_1_2\include\pcap-stdinc.h(80) : error C2054: expected '(' to follow '_W64' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap-stdinc.h(80) : error C2085: 'uintptr_t' : not in formal parameter list e:\vehiclesecurity\wpdpack_4_1_2\include\pcap-stdinc.h(89) : error C2628: '_W64' followed by 'int' is illegal (did you forget a ';'?) e:\vehiclesecurity\wpdpack_4_1_2\include\pcap-stdinc.h(89) : error C2085: 'intptr_t' : not in formal parameter list e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\bpf.h(67) : error C2085: 'bpf_int32' : not in formal parameter list e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\bpf.h(68) : error C2085: 'bpf_u_int32' : not in formal parameter list e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\bpf.h(908) : error C2061: syntax error : identifier 'bpf_u_int32' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\bpf.h(909) : error C2059: syntax error : '}' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(130) : error C2061: syntax error : identifier 'bpf_u_int32' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(133) : error C2061: syntax error : identifier 'thiszone' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(133) : error C2059: syntax error : ';' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(134) : error C2061: syntax error : identifier 'sigfigs' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(134) : error C2059: syntax error : ';' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(135) : error C2061: syntax error : identifier 'snaplen' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(135) : error C2059: syntax error : ';' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(136) : error C2061: syntax error : identifier 'linktype' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(136) : error C2059: syntax error : ';' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(137) : error C2059: syntax error : '}' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(169) : error C2061: syntax error : identifier 'bpf_u_int32' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(170) : error C2061: syntax error : identifier 'len' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(170) : error C2059: syntax error : ';' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(171) : error C2059: syntax error : '}' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(228) : error C2061: syntax error : identifier 'bpf_u_int32' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(229) : error C2059: syntax error : '}' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(272) : error C2143: syntax error : missing ')' before '*' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(272) : error C2081: 'bpf_u_int32' : name in formal parameter list illegal e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(272) : error C2143: syntax error : missing '{' before '*' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(272) : error C2059: syntax error : ',' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(272) : error C2059: syntax error : ')' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(287) : error C2122: 'char *' : prototype parameter in name list illegal e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(317) : error C2081: 'bpf_u_int32' : name in formal parameter list illegal e:\vehiclesecurity\wpdpack_4_1_2\include\pcap\pcap.h(319) : error C2081: 'bpf_u_int32' : name in formal parameter list illegal e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(57) : error C2065: 'bpf_u_int32' : undeclared identifier e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(57) : error C2146: syntax error : missing ';' before identifier 'NetMask' e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(57) : error C2065: 'NetMask' : undeclared identifier e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(58) : error C2143: syntax error : missing ';' before 'type' e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(59) : error C2143: syntax error : missing ';' before 'type' e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(60) : error C2143: syntax error : missing ';' before 'const' e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(154) : error C2065: 'res' : undeclared identifier e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(154) : error C2065: 'header' : undeclared identifier e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(154) : warning C4047: 'function' : 'struct pcap_pkthdr ** ' differs in levels of indirection from 'int *' e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(154) : warning C4024: 'pcap_next_ex' : different types for formal and actual parameter 2 e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(154) : error C2065: 'pkt_data' : undeclared identifier e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(154) : warning C4047: 'function' : 'const unsigned char ** ' differs in levels of indirection from 'int *' e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(154) : warning C4024: 'pcap_next_ex' : different types for formal and actual parameter 3 e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(162) : warning C4047: 'function' : 'const struct pcap_pkthdr *' differs in levels of indirection from 'int ' e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(162) : warning C4024: 'pcap_dump' : different types for formal and actual parameter 2 e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(162) : warning C4047: 'function' : 'const unsigned char *' differs in levels of indirection from 'int ' e:\vehiclesecurity\wpdpack_4_1_2\examples-pcap\pcap_filter\pcap_filter.c(162) : warning C4024: 'pcap_dump' : different types for formal and actual parameter 3 Error executing cl.exe. pf.exe - 41 error(s), 8 warning(s)
在pcap-stdinc.h文件最前面加上一句:
#define _WIN64
winpcap示例程序采用VC6编译时出错error C2054: expected '(' to follow '_W64'
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。