Winpcap环境配置

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值