Visual Studio Configuration WinPcap Environment

Source: Internet
Author: User

WinPcap 4.0.1 Online Chinese manualStart

This article takes Visual Studio 2013 and WinPcap 4.1.3 as an example, for both 32-bit and 64-bit Win7 Universal

1. Download and install the WinPcap Runtime Library

Http://www.winpcap.org/install/default.htm

Some packet capture software will be bundled with the installation of Winpcap,mentohust also comes with WinPcap, in which case you can generally skip this step.

2. Download WinPcap Development Package

Http://www.winpcap.org/devel.htm

Unzip to the plain English path and get the directory structure shown in 1:

3. New Project

Open Visual Studio with Administrator privileges, create a new Visual C + + WIN32 Console application, set to Empty project, 2:

4. Set up the project

Open the project properties, as shown in 3, WPCAP and HAVE_REMOTE define the two macros:

5. Add wpcap.libAnd ws2_32.libTwo of libraries.

6. Add the Include path (that is, figure 1 Includedirectory) and the library path (that is, figure 1 LibDirectory):

7. Setting up UAC

This step is not required, but recommended settings. Allows the generated program to automatically trigger the Administrator Permissions dialog box. In any case, the resulting program will need to run with administrator privileges.

8. Complete

After completing the above steps and clicking OK to save the settings, add the required source files to the project. For example, create a new C + + source file (you can also add an existing one)

Tips:Question 1

For the hint of the use of scanf unsafe problem: can be scanf changed to scanf_s , or directly in front of the #include<stdio.h> #define _CRT_SECURE_NO_WARNINGS warning can not be reported

Question 2

After selecting the network card after the error, the program is interrupted, presumably: you need to select the active network card, according to the model of the network card to determine the local connection, you can refer to the "Open Network and Sharing Center" in the order of the adapter.

Code sampleCourse Design of computer networkReference:

http://blog.csdn.net/kxcfzyk/article/details/20129867


Visual Studio Configuration WinPcap Environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.