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.