2010-05-03 11:08:36 Problem linking AgentX and net-snmp trap
Lorenzo Mariani (ITALY)
Message: 89094
Hi everyone,
I have some problems with AgentX (compile but do not link) and problems with net-snmp trap (the same), I'm compiling them with FLAT file type (I will try to compile with FDPIC file type as soon), i'm using bf536 uc with uClinux-dist-2009R1.1-RC4 version
I hope you can help me
Thanks in advance!
here is the "problematic code" (net-snmp)
snmp_varlist_add_variable(¬ification_vars,
objid_snmptrap, 9,
ASN_OBJECT_ID,
(u_char *) notification_oid,
11 * sizeof(oid));
snmp_varlist_add_variable(¬ification_vars,
bdg1_oid, 11,
ASN_OCTET_STR,
(u_char *)&bdg1Vect,
109*sizeof(unsigned char));
send_trap_vars(-1,-1,notification_vars);
snmp_free_varbind(notification_vars);
here is the output of eclipse linking
make all
Building target: tvg
Invoking: GCC C Linker
/opt/uClinux/bfin-uclinux/bin/bfin-uclinux-gcc -Wl,-elf2flt -L/home/lorenzo/blackfin/uClinux-dist/user/net-snmp/build/agent/.libs -L/home/marcoge/blackfin/uClinux-dist/user/net-snmp/build/agent/helpers/.libs -L/home/lorenzo/blackfin/uClinux-dist-2009R1.1-RC4/user/net-snmp/build/snmplib/.libs -o"tvg" ./badges.o ./key.o ./lcdDisplay.o ./lcdMenu.o ./main.o ./pps.o ./snmp.o ./uart1.o ./util.o -lm -lnetsnmpmibs -lnetsnmpagent -lnetsnmphelpers -lnetsnmp -lpthread
/home/lorenzo/blackfin/uClinux-dist-2009R1.1-RC4/user/net-snmp/build/snmplib/.libs/libnetsnmp.a(system.o): In function `netsnmp_daemonize':
../../net-snmp-5.2.1/snmplib/system.c:178: warning: fork: this function is not implemented on no-mmu systems
/home/lorenzo/blackfin/uClinux-dist/user/net-snmp/build/agent/.libs/libnetsnmpagent.a(snmp_vars.o): In function `init_agent':
../agent/mibgroup/agent_module_inits.h:2: undefined reference to `_should_init'
../agent/mibgroup/agent_module_inits.h:3: undefined reference to `_should_init'
../agent/mibgroup/agent_module_inits.h:4: undefined reference to `_should_init'
../agent/mibgroup/agent_module_inits.h:5: undefined reference to `_should_init'
/home/lorenzo/blackfin/uClinux-dist/user/net-snmp/build/agent/.libs/libnetsnmpagent.a(client.o): In function `agentx_open_session':
../../net-snmp-5.2.1/agent/mibgroup/agentx/client.c:139: undefined reference to `_version_sysoid'
../../net-snmp-5.2.1/agent/mibgroup/agentx/client.c:139: undefined reference to `_version_sysoid'
/home/lorenzo/blackfin/uClinux-dist/user/net-snmp/build/agent/.libs/libnetsnmpagent.a(master_admin.o): In function `remove_agent_caps_list':
../../net-snmp-5.2.1/agent/mibgroup/agentx/master_admin.c:397: undefined reference to `_unregister_sysORTable_sess'
/home/lorenzo/blackfin/uClinux-dist/user/net-snmp/build/agent/.libs/libnetsnmpagent.a(master_admin.o): In function `add_agent_caps_list':
../../net-snmp-5.2.1/agent/mibgroup/agentx/master_admin.c:382: undefined reference to `_register_sysORTable_sess'
/home/lorenzo/blackfin/uClinux-dist/user/net-snmp/build/agent/.libs/libnetsnmpagent.a(master_admin.o): In function `close_agentx_session':
../../net-snmp-5.2.1/agent/mibgroup/agentx/master_admin.c:165: undefined reference to `_unregister_sysORTable_by_session'
../../net-snmp-5.2.1/agent/mibgroup/agentx/master_admin.c:137: undefined reference to `_unregister_sysORTable_by_session'
collect2: ld returned 1 exit status
make: *** [tvg] Errore 1
And for agentx problem:
snmpd -H result:
master specify 'agentx' for AgentX support
agentxsocket AgentX bind address
agentxperms AgentX socket permissions: socket_perms [directory_perms [username|userid[groupname|groupid]]]
agentxRetries AgentX Retries
agentxTimeout AgentX Timeout (seconds)
sysdescr description
syslocation location
syscontact contact-name
sysname node-name
sysservices NUMBER
sysobjectid OID
engineID string
engineIDType num
engineIDNic string
In agentx.conf and agentx.local.conf:
agentxsocket AgentX bind address
agentxperms AgentX socket permissions: socket_perms [directory_perms [username|userid[groupname|groupid]]]
agentxRetries AgentX Retries
agentxTimeout AgentX Timeout (seconds)
this is my configuration of the config/.config file
CONFIG_USER_NETSNMP_SNMPD=y
CONFIG_USER_NETSNMP_SNMPD_MINI=y
# CONFIG_USER_NETSNMP_APPS is not set
CONFIG_USER_NETSNMP_BUILDSTATIC=y
# CONFIG_USER_NETSNMP_MANUALS is not set
# CONFIG_USER_NETSNMP_SCRIPTS is not set
# CONFIG_USER_NETSNMP_MIBS is not set
# CONFIG_USER_NETSNMP_NOV1 is not set
# CONFIG_USER_NETSNMP_NOV2C is not set
# CONFIG_USER_NETSNMP_IPV6 is not set
# CONFIG_USER_NETSNMP_NOTRANSPORTS is not set
# CONFIG_USER_NETSNMP_OPENSSL is not set
# CONFIG_USER_NETSNMP_OVRDEFAULTS is not set
CONFIG_USER_NETSNMP_ADDMIBS=y
CONFIG_USER_NETSNMP_ADDITIONALMIBS="my_mib agentx"
TranslateQuoteReplyEditDelete
2010-05-03 14:43:48 Re: Problem linking AgentX and net-snmp trap
Mike Frysinger (UNITED STATES)
Message: 89096
builds fine for me, but your output doesnt seem to make sense. there is no "tvg" target which means that is something you defined so it's probably a bug in something you wrote.
FLAT statically links which means library link order is important.
QuoteReplyEditDelete
2010-05-04 02:43:39 Re: Problem linking AgentX and net-snmp trap
Lorenzo Mariani (ITALY)
Message: 89100
tvg is just the artifact name, so eclipse creates an executable file named tvg
I see about FLAT, so is this order ( -lm -lnetsnmpmibs -lnetsnmpagent -lnetsnmphelpers -lnetsnmp -lpthread ) correct?
Many thanks for your help!