WEB开发网
开发学院操作系统windows 2008 深度剖析WinPcap之(五)——编译与使用WinPcap 阅读

深度剖析WinPcap之(五)——编译与使用WinPcap

 2009-09-11 00:00:00 来源:WEB开发网   
核心提示: 我们采用Microsoft Visual Studio 2005构建,同时不需要AirPcap适配器的支持,深度剖析WinPcap之(五)——编译与使用WinPcap(4),在Microsoft Visual Studio 2005中打开F:\winpcap\packetNtx\Dll\Proj

我们采用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 ==========

上一页  1 2 3 4 5  下一页

Tags:深度 剖析 WinPcap

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接