Updating from v4.1.2 to v4.3.0, compiling agent++ fails if snmp++ was compiled with --disable-snmpv3.
The problem is that several definitions are wrapped by “#ifdef _SNMPv3”
SNMP++ Configure
./configure --prefix=/mnt/swdevel/Torque/lib3p$LIBSUFFIX
–libdir=/mnt/swdevel/Torque/lib3p$LIBSUFFIX
–bindir=/mnt/swdevel/Torque/bin$LIBSUFFIX/util
–includedir=/mnt/swdevel/Torque/ext/extinclude/snmp++ --disable-snmpv3
AGENT++ Configure
./configure --prefix=/mnt/swdevel/Torque/lib3p$LIBSUFFIX \
--libdir=/mnt/swdevel/Torque/lib3p$LIBSUFFIX \
--with-libsnmp-prefix=/mnt/swdevel/Torque/lib3p$LIBSUFFIX \
--bindir=/mnt/swdevel/Torque/bin$LIBSUFFIX/util \
--includedir=/mnt/swdevel/Torque/ext/extinclude/agent++ \
WITH_NAMESPACE=1 STATIC_REQUEST_LIST=1 --enable-static=no \
CPPFLAGS="-I /mnt/swdevel/Torque/ext/extinclude/snmp++" \
snmp_LIBS="-L/mnt/swdevel/Torque/lib3p$LIBSUFFIX"
Error:
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I… -I…/include -pthread -I /mnt/swdevel/Torque/ext/extinclude/snmp++ -D_GNU_SOURCE -D_XOPEN_SOURCE=XPG6 -g -O2 -pthread -MT mib.lo -MD -MP -MF .deps/mib.Tpo -c mib.cpp -fPIC -DPIC -o .libs/mib.o
In file included from mib.cpp:31:
…/include/agent_pp/notification_originator.h:234:39: error: ‘snmpCommunityEntry’ has not been declared
void set_snmp_community_entry(snmpCommunityEntry* communityEntryRef) {
^~~~~~~~~~~~~~~~~~
…/include/agent_pp/notification_originator.h:246:17: error: ‘snmpCommunityEntry’ does not name a type; did you mean ‘oidSnmpCommunityEntry’?
virtual snmpCommunityEntry* get_snmp_community_entry();
^~~~~~~~~~~~~~~~~~
oidSnmpCommunityEntry
…/include/agent_pp/notification_originator.h:298:32: error: ‘nlmLogEntry’ has not been declared
void set_nlm_log_entry(nlmLogEntry* nlmLogEntryRef) {
Also, the call to “SnmpMessage::load(0, pdu, community, version, 0, 0, 0);” fails with "wrong number of arguments, since ‘mpv3’ isn’t declared when _SNMPv3 is not defined.
SnmpMessage() : bufflen(MAX_SNMP_PACKET), valid_flag(false) {};
// load up using a Pdu, community and SNMP version
// performs ASN.1 serialization
// result status returned
private:
int load(
#ifdef _SNMPv3
v3MP* mpv3,
#endif
const Pdu &pdu, // Pdu to serialize
const OctetStr &community, // community name to use
const snmp_version version, // SNMP version, v1 or v2
const OctetStr *engine_id, // optional v3
const OctetStr *security_name, // optional v3
const int security_model); // optional v3
public:
int load( const Pdu &pdu, // Pdu to serialize
const OctetStr &community, // community name to use
const snmp_version version) // SNMP version, v1 or v2
{
return load(0, pdu, community, version, 0, 0, 0);