SNMP ++ package usage and error handling

Source: Internet
Author: User
Tags snmp

Use of SNMP ++ for the application of the SNMP ++ Development Kit

 

When I use this management agreement, I am a newbie. I have been struggling with a problem for more than a day. I am going to summarize the following issues. Please advise me to correct them, to achieve our goal of learning together!
Problem: When an SNMP session is established in the application (that is, the unhandle exception in processor.exe (NTDLL. DLL): 0xc0000005: acess voilation dialog box. Before introducing this question, let's briefly talk about the application of SNMP ++.
First download an agent_snmp.zip package online (if you need it, contact me) to generate two files: snmp_pp.lib and snmp_pp.dll.
Method: accept. Create a folder and place these packages under the new folder. The decompressed folders do not contain each other. They are of the same level. At this time, you will see two snmp_pp_lib.dsw files. One is to generate the snmp_pp.lib file, and the other is to generate the snmp_pp.dll file. Use your installed VC tool to open these two files. If you need to check which file generates the snmp_pp.lib file and which file generates the snmp_pp.dll file, check the method: project-> Settings... -> link-> output
File Name: you will see what file is generated.
When the snmp_pp.dll file is generated, the file may not be found. The solution is to put the source file and header file in the snmp_pp folder under the project directory, replace # include "snmp_pp/snmp_pp.h" with # include "snmp_pp.h" and remove the preceding snmp_pp/file, or put the header files and source files used in the installation folder.
Copy the generated static link library file to the VC installation directory: \ vc98 \ Lib. You can use it like using other library files that come with VC.
After completing these tasks, create a new project based on the dialog box, such as mytest.
In the tools-> options...-> directories-> include directory, add the required include directory, src directory, libdes directory, and snmp_pp.lib directory.
Add snmp_pp.lib ws2_32.lib to object/library modules under project> Settings...> link and click OK. Rebuidle all
Do not forget to include # include "snmp_pp.h" in your project file ". When the following error occurs during compilation
Snmp_pp.lib (address. OBJ): Error lnk2001: unresolved external symbol _ htonl @ 4
Snmp_pp.lib (address. OBJ): Error lnk2001: unresolved external symbol_wsagetlasterror @ 0
Snmp_pp.lib (uxsnmp. OBJ): Error lnk2001: unresolved external symbol_wsagetlasterror @ 0
Snmp_pp.lib (policyqueue. OBJ): Error lnk2001: unresolved external symbol_wsagetlasterror @ 0
.
.
.
This is because you added ws2_32.lib to the object/library modules under project> Settings...> link, so remember to include this file.

This warning may occur during compilation: Waring link4098: Default "libcmtd". Conflict with use of other libs;/use/nodefaultlib: Library
Solution: on the project-> Settings...-> link page category: select input, and then write libcmtd. Lib in ignore libraries: click OK. Rebuidle all again. You will find the above problem in the SNMP m_snmp (Status); statement. Solution: Project-> Settings... -> Mircrosoft foundation class in general: Select use MFC in a static library, click OK, and rebuidle all again. This error is found
Nafxcwd. Lib (winctrl3.obj): Error lnk2001: unresolved external symbol _ atexit
.
.
Solution: on the project-> Settings...-> link page category: select input, write nafxcwd. Lib in ignore libraries:, and click OK, and then rebuidle all. Now everything is OK.
I used vc6.0 and passed the test!

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.