Hi all,
I am trying to link in an external library as part of cache loading routines
for MIB table_access code.
I added configure options for includes and libraries. It appears as the
library should be linked into libnetsnmpmibs.so
MY_INCLUDE="-O2 -Wall -I/home/abell/Software/app/cfgmon
-I/home/abell/Software/common"
MY_LIB="-L/home/abell/Software/app/cfgmon/build-x86/cfgmon.a"
configure --with-cflags=$MY_INCLUDE --with-ldflags=$MY_LIB
The compile was fine, the gcc compile lines have the needed include paths.
However, there is no addition of the MY_LIB into the gcc -shared line to
build the .so file. The MY_LIB IS exapnded into the
link line for the snmpd program either. I also tried --with-lib.
I could go into configure and modify it or the resultant makefile but this
does not seem like the right way to go.
Does anyone know how to link in an external library to the .so files?
Is it required to link against the .so before the link for snmpd.(seems
logical)
Thanks in advance,
Adam
----------------------------------------------------------------------------
----------------------------------------------------------------------------
---------------------------------
(This is the output of the run - specifically for libnetsnmpmib.so and the
last link command for snmpd)
/bin/sh ../libtool --mode=compile gcc -I../include -I. -I../agent
-I../agent/mibgroup -I../snmplib -I/usr/local/ssl/include -DINET6 -O2
-Wall -I/home/abell/Software/apps/cfgmon -I/home/abell/Software/common
-Dlinux -c -o mib_modules.lo mib_modules.c
rm -f .libs/mib_modules.lo
gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib
-I/usr/local/ssl/include -DINET6 -O2 -Wall
-I/home/abell/Software/apps/cfgmon -I/home/abell/Software/common -Dlinux -c
mib_modules.c -fPIC -DPIC -o mib_modules.o
mv -f mib_modules.o .libs/mib_modules.lo
gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib
-I/usr/local/ssl/include -DINET6 -O2 -Wall
-I/home/abell/Software/apps/cfgmon -I/home/abell/Software/common -Dlinux -c
mib_modules.c -o mib_modules.o >/dev/null 2>&1
mv -f .libs/mib_modules.lo mib_modules.lo
/bin/sh ../libtool --mode=link gcc -DINET6 -O2 -Wall
-I/home/abell/Software/apps/cfgmon -I/home/abell/Software/common -Dlinux
-rpath /usr/local/lib -version-info 9:1:0 -o libnetsnmpmibs.la
mibgroup/mibII/system_mib.lo (all other .los)
rm -fr .libs/libnetsnmpmibs.la .libs/libnetsnmpmibs.* .libs/libnetsnmpmibs.*
gcc -shared mibgroup/mibII/system_mib.lo (lots of other .lo files)
-Wl,-soname -Wl,libnetsnmpmibs.so.9 -o .libs/libnetsnmpmibs.so.9.0.1
//LIB DOES NOT SHOW UP HERE
(cd .libs && rm -f libnetsnmpmibs.so.9 && ln -s libnetsnmpmibs.so.9.0.1
libnetsnmpmibs.so.9)
(cd .libs && rm -f libnetsnmpmibs.so && ln -s libnetsnmpmibs.so.9.0.1
libnetsnmpmibs.so)
ar cru .libs/libnetsnmpmibs.a mibgroup/mibII/system_mib.o (all other .o
files) //LIB DOES NOT SHOW UP HERE
ranlib .libs/libnetsnmpmibs.a
creating libnetsnmpmibs.la
(cd .libs && rm -f libnetsnmpmibs.la && ln -s ../libnetsnmpmibs.la
libnetsnmpmibs.la)
: libnetsnmpmibs.la
/bin/sh ../libtool --mode=link gcc -DINET6 -O2 -Wall
-I/home/abell/Software/apps/cfgmon -I/home/abell/Software/common -Dlinux -o
snmpd snmpd.lo -L/usr/local/ssl/lib libnetsnmpmibs.la libnetsnmpagent.la
helpers/libnetsnmphelpers.la ../snmplib/libnetsnmp.la -ldl -lcrypto -lm
-L/home/abell/Software/apps/cfgmon/cfgmon_lib/build-x86/cfgmon.a
gcc -DINET6 -O2 -Wall -I/home/abell/Software/apps/cfgmon
-I/home/abell/Software/common -Dlinux -o .libs/snmpd snmpd.o
-L/usr/local/ssl/lib ./.libs/libnetsnmpmibs.so ./.libs/libnetsnmpagent.so
helpers/.libs/libnetsnmphelpers.so ../snmplib/.libs/libnetsnmp.so -ldl
-lcrypto -lm
-L/home/abell/Software/apps/cfgmon/cfgmon_lib/build-x86/cfgmon.a
-Wl,--rpath -Wl,/usr/local/lib
./.libs/libnetsnmpmibs.so: undefined reference to `CFGMON_read_data_file'
./.libs/libnetsnmpmibs.so: undefined reference to
`CFGMON_free_container_memory'
./.libs/libnetsnmpmibs.so: undefined reference to `CFGMON_show_data_file'
collect2: ld returned 1 exit status
make[1]: *** [snmpd] Error 1
The information contained in this electronic mail transmission may be
privileged and confidential, and therefore, protected from disclosure. If you
have received this communication in error, please notify us immediately by
replying to this message and deleting it from your computer without copying or
disclosing it.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders