SNMP ++ usage 1

Source: Internet
Author: User
Tags snmp

If you are using SNMP ++, the following error occurs!

-------------------- Configuration: TT-Win32 debug -------------------- linking... TT. OBJ: Error lnk2001: unresolved external symbol "public: Class IPaddress & _ thiscall IPaddress: Operator = (char const *)"(?? 4ipaddress @ qaeaav0 @ PBD @ Z) TT. OBJ: Error lnk2001: unresolved external symbol "public: void _ thiscall udpaddress: set_port (unsigned short )"(? Set_port @ udpaddress @ qaexg @ Z) TT. OBJ: Error lnk2001: unresolved external symbol "public: Class udpaddress & _ thiscall udpaddress: Operator = (char const *)"(?? 4udpaddress @ qaeaav0 @ PBD @ Z) TT. OBJ: Error lnk2001: unresolved external symbol "public: Unsigned short _ thiscall udpaddress: get_port (void) const "(? Get_port @ udpaddress @ qbegxz) TT. OBJ: Error lnk2001: unresolved external symbol "public: _ thiscall udpaddress: udpaddress (char const *)"(?? 0udpaddress @ Qae @ PBD @ Z) TT. OBJ: Error lnk2001: unresolved external symbol "public: _ thiscall IPaddress: IPaddress (char const *)"(?? 0ipaddress @ Qae @ PBD @ Z) TT. OBJ: Error lnk2001: unresolved external symbol "public: Virtual bool _ thiscall IPaddress: set_scope (unsigned INT )"(? Set_scope @ IPaddress @ uae_ni @ Z) TT. OBJ: Error lnk2001: unresolved external symbol "public: Virtual unsigned int _ thiscall IPaddress: get_scope (void) const "(? Get_scope @ IPaddress @ ubeixz) TT. OBJ: Error lnk2001: unresolved external symbol "public: Virtual int _ thiscall IPaddress: map_to_ipv6 (void )"(? Map_to_ipv6 @ IPaddress @ uaehxz) TT. OBJ: Error lnk2001: unresolved external symbol "protected: Virtual void _ thiscall IPaddress: format_output (void) const "(? Format_output @ IPaddress @ mbexxz) TT. OBJ: Error lnk2001: unresolved external symbol "protected: Virtual bool _ thiscall IPaddress: parse_address (char const *)"(? Parse_address @ IPaddress @ mae_npbd @ Z) TT. OBJ: Error lnk2001: unresolved external symbol "public: Virtual void _ thiscall IPaddress: clear (void )"(? Clear @ IPaddress @ uaexxz) TT. OBJ: Error lnk2001: unresolved external symbol "public: Virtual class snmpsyntax & _ thiscall IPaddress: Operator = (class snmpsyntax const &)"(?? 4ipaddress @ uaeaavsnmpsyntax @ abv1 @ Z) TT. OBJ: Error lnk2001: unresolved external symbol "protected: Virtual void _ thiscall address: clear (void )"(? Clear @ address @ maexxz) TT. OBJ: Error lnk2001: unresolved external symbol "public: _ thiscall IPaddress: IPaddress (class IPaddress const &)"(?? 0ipaddress @ Qae @ abv0 @ Z) TT. OBJ: Error lnk2001: unresolved exterpaddress: set_scope (unsigned INT )"(? Set_scope @ udpaddress @ uae_ni @ Z) TT. OBJ: Error lnk2001: unresolved external symbol "public: Virtual int _ thiscall udpaddress: map_to_ipv6 (void )"(? Map_to_ipv6 @ udpaddress @ uaehxz) TT. OBJ: Error lnk2001: unresolved external symbol "protected: Virtual void _ thiscall udpaddress: format_output (void) const "(? Format_output @ udpaddress @ mbexxz) TT. OBJ: Error lnk2001: unresolved external symbol "protected: Virtual bool _ thiscall udpaddress: parse_address (char const *)"(? Parse_address @ udpaddress @ mae_npbd @ Z) TT. OBJ: Error lnk2001: unresolved external symbol "public: Virtual class snmpsyntax & _ thiscall udpaddress: Operator = (class snmpsyntax const &)"(?? 4udpaddress @ uaeaavsnmpsyntax @ abv1 @ Z) TT. OBJ: Error lnk2001: unresolved external symbol "public: _ thiscall udpaddress: udpaddress (class udpaddress const &)"(?? 0udpaddress @ Qae @ abv0 @ Z) debug/tt.exe: Fatal error lnk1120: 21 unresolved externals error when executing link.exe .tt.exe-1 error (s), 0 warning (s)

Refer to this document for editing and using SNMP ++ in vc6 (3) This article provides a solution to the problem that occurs during compilation.
Ws2_32.lib is added to the object/Library module (engineering/Setup/connection/General), but the given program is incomplete,

#include "snmp_pp.h"#include "iostream.h"void main(){ IpAddress ip("127.0.0.1"); cout<<"ip address is:"<<ip<<endl; UdpAddress udp("127.0.0.1:8888"); cout<<"udp address is:"<<udp<<endl; cout<<"udp address port is:"<<udp.get_port()<<endl; udp="127.0.0.1"; udp.set_port(9999); cout<<udp<<endl; ip="258.0.0.1";  if(!ip.valid())   cout<<"bad ip:258.0.0.1"<<endl;  else   cout<<"good ip:258.0.0.1"<<endl;  ip="255.0.0.1"; if(!ip.valid())  cout<<"error ip:255.0.0.1"<<endl; else  cout<<"good ip:255.0.0.1"<<endl; ip="0.0.0.0"; if(!ip.valid())  cout<<"error ip:0.0.0.0"<<endl; else  cout<<"good ip:0.0.0.0"<<endl; ip="255.255.255.255";  if(!ip.valid())   cout<<"error ip:255.255.255.255"<<endl;  else   cout<<"good ip:255.255.255.255"<<endl;}

So far, your problem has been solved.

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.