VS2005 下编译wireshark-1.10.0rc2

WINXP SP2 VS2005 下编译wireshark-1.10.0rc2出现以下错误

capture_win_ifnames.c
capture_win_ifnames.c(236) : error C2065: 'IF_MAX_STRING_SIZE' : undeclared identifier
capture_win_ifnames.c(236) : error C2057: expected constant expression
capture_win_ifnames.c(236) : error C2466: cannot allocate an array of constant size 0
capture_win_ifnames.c(236) : error C2133: 'wName' : unknown size
capture_win_ifnames.c(258) : error C2146: syntax error : missing ')' before identifier 'InterfaceLuid'
capture_win_ifnames.c(258) : error C2081: 'PNET_LUID' : name in formal parameter list illegal
capture_win_ifnames.c(258) : error C2146: syntax error : missing ';' before identifier 'InterfaceLuid'
capture_win_ifnames.c(258) : error C2059: syntax error : ')'
capture_win_ifnames.c(258) : error C2065: 'InterfaceLuid' : undeclared identifier
capture_win_ifnames.c(259) : error C2143: syntax error : missing ';' before 'type'
capture_win_ifnames.c(262) : error C2275: 'ProcAddr_CIG2L' : illegal use of this type as an expression
        capture_win_ifnames.c(258) : see declaration of 'ProcAddr_CIG2L'
capture_win_ifnames.c(262) : error C2146: syntax error : missing ';' before identifier 'proc_ConvertInterfaceGuidToLuid'


capture_win_ifnames.c(262) : error C2065: 'proc_ConvertInterfaceGuidToLuid' : undeclared identifier
capture_win_ifnames.c(262) : warning C4047: '=' : 'int' differs in levels of indirection from 'ProcAddr_CIG2L'
capture_win_ifnames.c(263) : warning C4047: '!=' : 'int' differs in levels of indirection from 'void *'
capture_win_ifnames.c(264) : error C2065: 'ProcAddr_CIL2A' : undeclared identifier
capture_win_ifnames.c(264) : error C2146: syntax error : missing ';' before identifier 'Proc_ConvertInterfaceLuidToAlias'
capture_win_ifnames.c(264) : error C2065: 'Proc_ConvertInterfaceLuidToAlias' : undeclared identifier
capture_win_ifnames.c(264) : error C2146: syntax error : missing ';' before identifier 'GetProcAddress'
capture_win_ifnames.c(265) : warning C4047: '!=' : 'int' differs in levels of indirection from 'void *'
capture_win_ifnames.c(267) : error C2065: 'NET_LUID' : undeclared identifier
capture_win_ifnames.c(267) : error C2146: syntax error : missing ';' before identifier 'InterfaceLuid'
capture_win_ifnames.c(268) : error C2063: 'proc_ConvertInterfaceGuidToLuid' : not a function
capture_win_ifnames.c(271) : error C2063: 'Proc_ConvertInterfaceLuidToAlias' : not a function
capture_win_ifnames.c(304) : warning C4034: sizeof returns 0
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

原因是没有安装SDK,找不到ifdef.h

解决方法有2种

1.安装SDK

2.修改capture_win_ifnames.c

#ifndef NDIS_IF_MAX_STRING_SIZE
#ifndef IF_MAX_STRING_SIZE
#define IF_MAX_STRING_SIZE 256
#endif
#define NDIS_IF_MAX_STRING_SIZE IF_MAX_STRING_SIZE   /* =256 in <ifdef.h> */
#endif

#ifndef NET_LUID
typedef union _NET_LUID {
  ULONG64 Value;
  struct {
    ULONG64 Reserved  :24;
    ULONG64 NetLuidIndex  :24;
    ULONG64 IfType  :16;
  } Info;
} NET_LUID, *PNET_LUID;
#endif

编译正常。




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值