Robert,
Thanks for getting back to me on this. I updated my make file as your website suggests. But now I am back to the link order problem and unresolved externals. I think it is a link order problem because if I rearrange how I list the snmp libraries, I get different unresolved externals.
Thanks,
Alan
Here is my link output.
- bld1-dsm> make
cc -o example-demon example-demon.o nstAgentSubagentObject.o -L/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/.libs -L/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/snmplib/.libs -L/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/helpers/.libs -Wl,-Bstatic -lnetsnmpagent -lnetsnmpmibs -lnetsnmphelpers -lnetsnmp -Wl,-Bdynamic -ldl -lcrypto -lm/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/.libs/libnetsnmpmibs.a(extensible.o)(.text+0x76d): In function `var_extensible_shell':
/vobs/vob3/net-snmp/src/agent/mibgroup/ucd-snmp/extensible.c:470: undefined reference to `run_shell_command'
/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/.libs/libnetsnmpmibs.a(extensible.o)(.text+0x7d9):/vobs/vob3/net-snmp/src/agent/mibgroup/ucd-snmp/extensible.c:467: undefined reference to `run_exec_command'
/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/.libs/libnetsnmpmibs.a(extensible.o)(.text+0x821):/vobs/vob3/net-snmp/src/agent/mibgroup/ucd-snmp/extensible.c:459: undefined reference to `run_shell_command'
/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/.libs/libnetsnmpmibs.a(extensible.o)(.text+0x853):/vobs/vob3/net-snmp/src/agent/mibgroup/ucd-snmp/extensible.c:456: undefined reference to `run_exec_command'
/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/.libs/libnetsnmpmibs.a(extensible.o)(.text+0xbb4): In function `var_extensible_relocatable':
/vobs/vob3/net-snmp/src/agent/mibgroup/ucd-snmp/extensible.c:597: undefined reference to `run_shell_command'
/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/.libs/libnetsnmpmibs.a(extensible.o)(.text+0xcc1):/vobs/vob3/net-snmp/src/agent/mibgroup/ucd-snmp/extensible.c:594: undefined reference to `run_exec_command'
/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/.libs/libnetsnmpmibs.a(extensible.o)(.text+0xd2e):/vobs/vob3/net-snmp/src/agent/mibgroup/ucd-snmp/extensible.c:587: undefined reference to `run_shell_command'
/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/.libs/libnetsnmpmibs.a(extensible.o)(.text+0xd74):/vobs/vob3/net-snmp/src/agent/mibgroup/ucd-snmp/extensible.c:584: undefined reference to `run_exec_command'
/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/.libs/libnetsnmpmibs.a(extend.o)(.text+0x3ab): In function `extend_load_cache':
/vobs/vob3/net-snmp/src/agent/mibgroup/agent/extend.c:218: undefined reference to `run_shell_command'
/vobs/vob3/net-snmp/doc/tutorial/../../tfs/x86/agent/.libs/libnetsnmpmibs.a(extend.o)(.text+0x4b3):/vobs/vob3/net-snmp/src/agent/mibgroup/agent/extend.c:220: un
defined reference to `run_exec_command'
collect2: ld returned 1 exit status
make: *** [example-demon] Error 1
bld1-dsm>
- NET_SNMP_ROOT=/vobs/vob3/net-snmp
NET_SNMP_SRC=/vobs/vob3/net-snmp/src
NET_SNMP_COM=/vobs/vob3/net-snmp/common
MIBDIRS=/vobs/vob3/net-snmp/src/mibs:/vobs/vob3/net-snmp/doc/tutorial
SNMPCONFPATH=/vobs/vob3/net-snmp/common/etc/snmp
NETSNMPDIR=/vobs/vob3/net-snmp/tfs/x86
NETSNMPCONFIG=/vobs/vob3/net-snmp/tfs/x86/net-snmp-config
PERL5LIB=/vobs/vob3/net-snmp/tfs/x86/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
build: mkdir
echo ******* This line should be removed at some point... --ala
cp -f ${NET_SNMP_ROOT}/doc/tutorial/nstAgentModuleObject.? ${NET_SNMP_ROOT}/src/agent/mibgroup
cd ${NETSNMPDIR} ; ${NET_SNMP_SRC}/configure \
--with-mib-modules="nstAgentModuleObject" \
--with-default-snmp-version="2" \
--with-sys-contact="[EMAIL PROTECTED]" \
--with-sys-location="No where" \
--with-logfile="none" \
--with-persistent-directory="${NETSNMPDIR}/var/net-snmp" \
${NET_SNMP_OPTS} \
--prefix="${NETSNMPDIR}"
cd ${NETSNMPDIR} ; ${MAKE}
02/18/2005 11:09 AM
|
|
On Fri, 18 Feb 2005 08:52:12 -0600 [EMAIL PROTECTED] wrote:
AAC> I tried static linking but I got lost in a maze of link order problems. I
AAC> would rather get the dynamic debugging going but I am open to static
AAC> linking if some one could help with the link order.
I always use static linking when testing, for exactly this reason. Debugging
shared libs is a pain. Here is the makefile I use:
http://www.freesnmp.com/net-snmp/faqs/#static
--
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
<<inline: graycol.gif>>
<<inline: pic27232.gif>>
<<inline: ecblank.gif>>
