Using Agent++ and SNMP++ inside a Win32 DLL

Fernando Marotta F.Marotta____itsoftware.it
Tue Jan 21 11:04:28 CET 2003


Hi everybody,

I'm trying to use the agent++ and snmp++ classes inside a Windows DLL (the
final target is to produce an extension agent for the WinSNMP service, and
maybe use also agentx++ inside WinSNMP),

I've built snmp++.lib and agent++.lib files (in debug release, using
multithread option), and trying to write a test dll using these classes,
this is a function I'm writing (from winsnmp specs):


-------------------------------------------------

BOOL WINAPI SnmpExtensionQuery(
    IN BYTE                   requestType,
    IN OUT RFC1157VarBindList *variableBindings,
    OUT AsnInteger            *errorStatus,
    OUT AsnInteger            *errorIndex)
{
	*errorIndex = 0;
	*errorStatus = SNMP_ERRORSTATUS_NOERROR;

	Vbx* pVb;

	pVb = new Vbx();

	return SNMPAPI_NOERROR;
} // end SnmpExtensionQuery()

-------------------------------------------------



even this simple code produces some errors, in particular:

- this obscure warning:
D:\Prove\SNMP\agent++\include\List.h(1353) : warning C4275: non
dll-interface class 'Array<class MibLeaf>' used as base for dll-interface
class 'OrderedArray<class MibLeaf>'
        D:\Prove\SNMP\agent++\include\mib.h(762) : see reference to class
template instantiation 'OrderedArray<class MibLeaf>' being compiled

- some symbol redefinitions (non-issue, symbols like ASN_UNIVERSAL are
redefined by winsnmp, but with the same value)

- this errors:
ExtDll1.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: __thiscall Vbx::Vbx(void)"
(__imp_??0Vbx@@QAE at XZ)

(the same if I try to use a Request or Pdux object: the constructors are not
resolved)


can somebody please help me?

(note that I just want to use the libs, I don't need to export the
snmp++/agent++/agentx++ classes from my DLL)


Thanks in advance
Cheers


Fernando




More information about the AGENTPP mailing list