[AGENT++] Hi all!!!

Frank Fock fock at agentpp.com
Fri Mar 19 09:05:19 CET 2004


Hi,

you also need to build the SNMP++ lib itself and (depending on your project
structure) add the lib in the dependencies properties to your example
project.

Best regards,
Frank

风间仓月 wrote:

>Hi all:
>
>	I have some problem wiht a simple example(SNMP++), I compile this example in the following steps:
>
>	1, Add the directories of the *.h files of agent++(agent++v3.5.16b) and snmp++(snmp++v3.2.10a) to
>
>	   VC6.0->toos->options->directories
>
>	2, Then create a new c++ source file and past the following code here:
>
>	#include "snmp_pp.h"
>	#include <iostream.h>
>	#define SYSDESCR "1.3.6.1.2.1.1.1.0"     // Object ID for System Descriptor
>	void get_system_descriptor()
>	{
>   	int status;           // return status       
>   	CTarget ctarget( (IpAddress) "10.4.8.5");   // SNMP++ community target 
>   	Vb vb( SYSDESCR);               // SNMP++ Variable Binding Object
>   	Pdu pdu;                                // SNMP++ PDU
>
>    //-------[ Construct a SNMP++ SNMP Object 
>]---------------------------------------
>   Snmp snmp( status);     // Create a SNMP++ session
>   if ( status != SNMP_CLASS_SUCCESS) {       // check creation status
>      cout << snmp.error_msg( status);        //  if fail, print error string
>      return;  }
>
>
>   //-------[ Invoke a SNMP++ Get 
>]-------------------------------------------------------
>   pdu += vb;          //  add the variable binding to the PDU
>   if (  (status = snmp.get(  pdu, ctarget)) != SNMP_CLASS_SUCCESS)
>      cout << snmp.error_msg( status);
>   else {
>      pdu.get_vb( vb,0);                 // extract the variable binding from PDU
>      cout << "System Descriptor = "<< vb.get_printable_value();  }  // print 
>out the value
>
>
>};  // Thats all!
>
> 
>
>3, Then I compile it, but have the following problems here:
>
>11.obj : error LNK2001: unresolved external symbol "public: char const * 
>__thiscall Vb::get_printable_value(void)const " 
>(?get_printable_value at Vb@@QBEPBDXZ <mailto:?get_printable_value at Vb@@QBEPBDXZ>)
>11.obj : error LNK2001: unresolved external symbol "public: int __thiscall 
>Pdu::get_vb(class Vb &,int)const " (?get_vb at Pdu@@QBEHAAVVb@@H at Z 
><mailto:?get_vb at Pdu@@QBEHAAVVb@@H at Z>)
>11.obj : error LNK2001: unresolved external symbol "public: virtual int 
>__thiscall Snmp::get(class Pdu &,class SnmpTarget const &)" 
>(?get at Snmp@@UAEHAAVPdu@@ABVSnmpTarget@@@Z 
><mailto:?get at Snmp@@UAEHAAVPdu@@ABVSnmpTarget@@@Z>)
>11.obj : error LNK2001: unresolved external symbol "public: class Pdu & 
>__thiscall Pdu::operator+=(class Vb const &)" (??YPdu@@QAEAAV0 at ABVVb@@@Z 
><mailto:??YPdu@@QAEAAV0 at ABVVb@@@Z>)
>11.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall 
>Pdu::~Pdu(void)" (??1Pdu@@UAE at XZ <mailto:??1Pdu@@UAE at XZ>)
>11.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall 
>Snmp::~Snmp(void)" (??1Snmp@@UAE at XZ <mailto:??1Snmp@@UAE at XZ>)
>11.obj : error LNK2001: unresolved external symbol "public: static char const * 
>__cdecl Snmp::error_msg(int)" (?error_msg at Snmp@@SAPBDH at Z 
><mailto:?error_msg at Snmp@@SAPBDH at Z>)
>11.obj : error LNK2001: unresolved external symbol "public: __thiscall 
>Snmp::Snmp(int &,unsigned short)" (??0Snmp@@QAE at AAHG@Z <mailto:??0Snmp@@QAE at AAHG@Z>)
>11.obj : error LNK2001: unresolved external symbol "public: __thiscall 
>Pdu::Pdu(void)" (??0Pdu@@QAE at XZ <mailto:??0Pdu@@QAE at XZ>)
>11.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall 
>Oid::~Oid(void)" (??1Oid@@UAE at XZ <mailto:??1Oid@@UAE at XZ>)
>11.obj : error LNK2001: unresolved external symbol "public: __thiscall 
>Oid::Oid(char const *)" (??0Oid@@QAE at PBD@Z <mailto:??0Oid@@QAE at PBD@Z>)
>11.obj : error LNK2001: unresolved external symbol "public: __thiscall 
>CTarget::CTarget(class Address const &)" (??0CTarget@@QAE at ABVAddress@@@Z 
><mailto:??0CTarget@@QAE at ABVAddress@@@Z>)
>11.obj : error LNK2001: unresolved external symbol "public: __thiscall 
>IpAddress::IpAddress(char const *)" (??0IpAddress@@QAE at PBD@Z 
><mailto:??0IpAddress@@QAE at PBD@Z>)
>11.obj : error LNK2001: unresolved external symbol "public: virtual int 
>__thiscall IpAddress::map_to_ipv6(void)" (?map_to_ipv6 at IpAddress@@UAEHXZ 
><mailto:?map_to_ipv6 at IpAddress@@UAEHXZ>)
>11.obj : error LNK2001: unresolved external symbol "protected: virtual void 
>__thiscall IpAddress::format_output(void)const " 
>(?format_output at IpAddress@@MBEXXZ <mailto:?format_output at IpAddress@@MBEXXZ>)
>
> 
>
> 
>
>Can any body tell me how to do with it step by step. Thanks a lot!!
>
>========================== 263电子邮件-信赖邮自专业
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>AGENTPP mailing list
>AGENTPP at agentpp.org
>http://agentpp.org/mailman/listinfo/agentpp
>  
>






More information about the AGENTPP mailing list