1.VC++6.0中:
首先: 在未配置过的上面需要配置include文件和library文件
在Tools->options 中:
1.Show directory for:下 include files 添加:include文件的路径
2.Show directory for: Library files 添加:lib 文件的路径
在每一次建完工程之后:
project -> setting 下
1. C/C++ : Processor definition 添加 “WPCAP”
2. Link : Object/library modules 添加 “wsock32.lib wpcap.lib Packet.lib”
2.VS2003中:
每一次建完工程之后:
Project -> XXX Properties 下:
1. C/C++ :General-> Additional Include Directories 添加 : include路径
Processor->Processor definition 添加 :“WPCAP”
2. Linker :General -> Additional Library Directories 添加 : lib 路径
Comand Line -> Additional Options 添加 : “wsock32.lib wpcap.lib Packet.lib”
原文:
To create an application that uses wpcap.dll with Microsoft Visual C++, follow these steps:
Include the file pcap.h at the beginning of every source file that uses the functions exported by library.
If your program uses Win32 specific functions of WinPcap, remember to include WPCAP among the preprocessor definitions.
Set the options of the linker to include the wpcap.lib library file. wpcap.lib can be found in the WinPcap developer's pack.
Set the options of the linker to include the winsock library file (for example wsock32.lib). This file is distributed with the C compiler and contains the socket functions for Windows. It is needed by some libpcap functions.
Remember that:
To add a preprocessor definition, you must select Settings from the Project menu, then select C/C++ from the tab control, and under the category General, you must add the definition under the Preprocessor Definitions text box.
To add a new library to the project with Microsoft Visual C++, you must select Settings from the Project menu, then select Link from the tab control, and then add the name of the new library in the Objcet/library modules editbox.
To add a new path where Microsoft Visual C++ will look for the libraries, you must select Options from the Tools menu, then Directories from the tab control, Library files from the Show directories for combobox, and the add the path in the Directories box.
To add a new path where Microsoft Visual C++ will look for include files, you must select Options from the Tools menu, then Directories from the tab control, Include files from the Show directories for combobox, and the add the path in the Directories box.