深度剖析WinPcap之(五)——编译与使用WinPcap
2009-09-11 00:00:00 来源:WEB开发网我们采用Microsoft Visual Studio 2005构建,同时不需要AirPcap适配器的支持。在Microsoft Visual Studio 2005中打开F:\winpcap\packetNtx\Dll\Project\ Packet.sln工程,选择Release配置构建PACKET.DLL库,如果为了调试也可以选择Debug配置。
选择Release配置,开始构建,在Microsoft Visual Studio 2005中选择菜单[Build]执行菜单项[Rebuild Packet],执行结果如下:
1>------ Rebuild All started: Project: Packet, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'Packet', configuration 'Release|Win32'
1>Compiling...
1>win_bpf_filter.c
1>Packet32.c
1>f:\winpcap\Common\packet32.h(53) : fatal error C1083: Cannot open include file: 'airpcap.h': No such file or directory
1>NpfImExt.c
1>AdInfo.c
1>f:\winpcap\Common\packet32.h(53) : fatal error C1083: Cannot open include file: 'airpcap.h': No such file or directory
1>Build log was saved at "file://f:\winpcap\packetNtx\Dll\Project\Release\x86\BuildLog.htm"
1>Packet - 2 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
编译出错,无法打开airpcap.h文件,此处不需要支持AirPcap适配器,所以
在文件Packet32-Int.h的第50行添加#undef HAVE_AIRPCAP_API,再重新构建,执行结果如下:
1>------ Rebuild All started: Project: Packet, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'Packet', configuration 'Release|Win32'
1>Compiling...
1>win_bpf_filter.c
1>Packet32.c
1>Compiling Packet.dll with support for WanPacket (aka Dialup thru NetMon)
1>Compiling Packet.dll with support from IP helper API for API addresses
1>NpfImExt.c
1>AdInfo.c
1>Compiling...
1>WanPacket.cpp
1>Compiling resources...
1>Linking...
1> Creating library f:\winpcap\packetNtx\Dll\Project\\Release\x86\Packet.lib and object f:\winpcap\packetNtx\Dll\Project\\Release\x86\Packet.exp
1>Generating code
1>Finished generating code
1>Embedding manifest...
1>Build log was saved at "file://f:\winpcap\packetNtx\Dll\Project\Release\x86\BuildLog.htm"
1>Packet - 0 error(s), 0 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
- ››深度解释攻击linux服务器的四种级别
- ››剖析java.util.concurrent锁
- ››剖析Android智能手机系统的更多功能
- ››深度分析地方社区网站的内容定位
- ››剖析Windows Azure Platform框架与组成
- ››剖析使用 ObjectOutputStream 可能引起的内存泄漏...
- ››剖析EWebEditor编辑器漏洞攻击案例
- ››剖析开源云:构建 Infrastructure as a Service 块...
- ››深度剖析 Android 和 iPhone OS
- ››深度分析:HTML5能否成为Flash终结者
- ››深度挖掘 更多Windows 7快捷模式
- ››深度挖掘 Windows 7快捷模式
更多精彩
赞助商链接