This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--===============0180061516==
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C78B4B.5DCF5C40"

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C78B4B.5DCF5C40
Content-Type: text/plain

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.
------_=_NextPart_001_01C78B4B.5DCF5C40
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

=


-ASCII">




Hi=
=20
all,

size=3D2> 

I=20=
am=20trying=20to=20link=20
in=20an=20external=20library=20as=20part=20of=20ca che=20loading=20routines=
=20for=20MIB=20table_access=20
code.

I=20=
added=20configure=20
options=20for=20includes=20and=20libraries. =20It= 20appears=20as=20th=
e=20library=20should=20be=20
linked=20into  face=3DArial=20
size=3D2>libnetsnmpmibs.so

size=3D2> 

size=3D2> 

MY=
_INCLUDE=3D"-O2=20
-Wall=20-I/home/abell/Software/app/cfgmon=20
-I/home/abell/Software/common"

size=3D2>MY_LIB=3D"-L/home/abell/Software/app/cfgmon/build-x86/cfgmon.a" FONT>

size=3D2> 

co=
nfigure=20
--with-cflags=3D$MY_INCLUDE=20--with-ldflags=3D$MY_LIB
=

size=3D2> 

Th=
e=20compile=20was=20
fine,=20the=20gcc=20compile=20lines=20have=20the=2 0
needed include paths.

size=3D2> 

Ho=
wever,  =20
there=20is=20no=20addition=20of=20the=20MY_LIB=20i nto=20the=20gcc=20-share=
d=20line=20to=20build=20the=20.so=20
file. =20The=20MY_LIB=20IS=20exapnded=20into=20the =20 DIV>
li=
nk=20line=20for=20the=20
snmpd=20program=20either. =20I=20also=20tried=20--with-lib. PAN>

size=3D2> 

I=20=
could=20go=20into=20
configure=20and=20modify=20it=20or=20the=20resulta nt=20makefile=20but=20th=
is=20does=20not=20seem=20like=20
the=20right=20way=20to=20go.

size=3D2> 

Do=
es=20anyone=20know=20how=20
to=20link=20in=20an=20external=20library=20to=20th e=20.so=20files?<=
/SPAN>

Is=
=20it=20required=20to=20
link=20against=20the=20.so=20before=20the=20link=2 0for=20snmpd.(seems=20
logical)

size=3D2> 

Th=
anks=20in=20
advance,

size=3D2>Adam

size=3D2> 

size=3D2>-----------------------------------------------------------------=
--------------------------------------------------------------------------=
----------------------------------------------

(T=
his=20is=20the=20output=20
of=20the=20run=20-=20specifically=20for=20libnetsnmpmib.so=20and=20t he=20l=
ast=20link=20command=20for=20
snmpd)

 

/b=
in/sh=20
.../libtool =20--mode=3Dcompile=20gcc=20-I../include=20-I.=20-I../agen=
t=20
-I../agent/mibgroup=20-I../snmplib=20-I/usr/local/ssl/include  =20=
-DINET6=20
-O2=20-Wall=20-I/home/abell/Software/apps/cfgmon=20
-I/home/abell/Software/common
=20-Dlinux =20-c=20-o=20mib_mod=
ules.lo=20
mib_modules.c

 

rm=
=20-f=20
..libs/mib_modules.lo
gcc=20-I../include=20-I.=20-I../agent=20-I../agent=
/mibgroup=20
-I../snmplib=20-I/usr/local/ssl/include=20-DINET6=20-O2=20-Wall=20
-I/home/abell/Software/apps/cfgmon=20-I/home/abell/Software/common=20-Dlin=
ux=20-c=20
mib_modules.c =20-fPIC=20-DPIC=20-o=20mib_modules.o
mv=20-f=20mib_=
modules.o=20
..libs/mib_modules.lo

 

gc=
c=20-I../include=20-I.=20
-I../agent=20-I../agent/mibgroup=20-I../snmplib=20-I/usr/local/ssl/include=
=20-DINET6=20-O2=20
-Wall=20-I/home/abell/Software/apps/cfgmon=20-I/home/abell/Software/common=
=20-Dlinux=20
-c=20mib_modules.c=20-o=20mib_modules.o=20>/dev/null=202>&1
m=
v=20-f=20
..libs/mib_modules.lo=20mib_modules.lo

 

/b=
in/sh=20
.../libtool =20--mode=3Dlink=20gcc=20-DINET6=20-O2=20-Wall=20
-I/home/abell/Software/apps/cfgmon=20-I/home/abell/Software/common=20-Dlin=
ux =20
-rpath=20/usr/local/lib=20-version-info=209:1:0=20-o=20libnetsnmpmibs.la=20=

mibgroup/mibII/system_mib.lo=20(all=20other=20.los) =20
rm=20-fr=20=

..libs/libnetsnmpmibs.la=20.libs/libnetsnmpmibs.*=20
..libs/libnetsnmpmibs.*

 

gc=
c=20-shared =20
mibgroup/mibII/system_mib.lo=20(lots=20of=20other .lo=20files) &=
nbsp;=20
-Wl,-soname=20-Wl,libnetsnmpmibs.so.9=20-o=20
..libs/libnetsnmpmibs.so.9.0.1       =20=

//LIB=20DOES=20NOT=20SHOW=20UP=20HERE
=

 

size=3D2> 

 

(c=
d=20.libs=20&&=20
rm=20-f=20libnetsnmpmibs.so.9=20&&=20ln=20-s=20libnetsnmpmibs.so.9=
..0.1=20
libnetsnmpmibs.so.9)
(cd=20.libs=20&&=20rm=20-f=20libnetsnmpmib=
s.so=20&&=20
ln=20-s=20libnetsnmpmibs.so.9.0.1=20libnetsnmpmibs.so)
=

 

ar=
=20cru=20
..libs/libnetsnmpmibs.a =20mibgroup/mibII/system_mib.o =20(all=20=
other=20.o=20
files)           =20=
//LIB=20
DOES=20NOT=20SHOW=20UP=20HERE
ranlib=20.libs/libnetsnmpmibs.a PAN>

 

cr=
eating=20
libnetsnmpmibs.la
(cd=20.libs=20&&=20rm=20-f=20libnetsnmpmibs.l=
a=20&&=20ln=20
-s=20../libnetsnmpmibs.la=20libnetsnmpmibs.la)
:=20
libnetsnmpmibs.la

 

size=3D2> 

 

size=3D2> 

 

/b=
in/sh=20
.../libtool =20--mode=3Dlink=20gcc=20-DINET6=20-O2=20-Wall=20
-I/home/abell/Software/apps/cfgmon=20
-I/home/abell/Software/common
=20-Dlinux =20-o=20snmpd=20
snmpd.lo  =20-L/usr/local/ssl/lib  =20libnetsnmpmibs.l=
a=20
libnetsnmpagent.la=20helpers/libnetsnmphelpers.la =20../snmplib/libne=
tsnmp.la=20
-ldl=20-lcrypto=20-lm=20
-L/home/abell/Software/apps/cfgmon/cfgmon_lib/build-x86/cfgmon.a STRONG> =20

R>gcc=20-DINET6=20-O2=20
-Wall=20-I/home/abell/Software/apps/cfgmon=20
-I/home/abell/Software/common
=20-Dlinux=20-o=20.libs/snmpd=20snmp=
d.o =20
-L/usr/local/ssl/lib=20./.libs/libnetsnmpmibs.so=20./.libs/libnetsnmpagent=
..so=20
helpers/.libs/libnetsnmphelpers.so=20../snmplib/.libs/libnetsnmp.so=20-ldl=
=20-lcrypto=20
-lm=20
-L/home/abell/Software/apps/cfgmon/cfgmon_lib/build-x86/cfgmon.a STRONG> =20
-Wl,--rpath=20-Wl,/usr/local/lib
./.libs/libnetsnmpmibs.so:=20u=
ndefined=20
reference=20to=20`CFGMON_read_data_file'
./.libs/libnetsnmpmibs.so:=20u=
ndefined=20
reference=20to=20`CFGMON_free_container_memory'
./.libs/libnetsnmpmibs.=
so:=20
undefined=20reference=20to=20`CFGMON_show_data_fil e'
collect2:=
=20ld=20returned=20
1=20exit=20status
make[1]:=20***=20[snmpd]=20Error=20
1




The=20information=20contained=20in=20this=20electr onic=20mail=20transmissi=
on=20may=20be=20privileged=20and=20confidential,=2 0and=20therefore,=20prot=
ected=20from=20disclosure.=20If=20you=20have=20rec eived=20this=20communica=
tion=20in=20error,=20please=20notify=20us=20immedi ately=20by=20replying=20=
to=20this=20message=20and=20deleting=20it=20from=2 0your=20computer=20witho=
ut=20copying=20or=20disclosing=20it.



------_=_NextPart_001_01C78B4B.5DCF5C40--


--===============0180061516==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
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/
--===============0180061516==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

--===============0180061516==--