I am compiling the subagent by issuing the "make -f
ocStbHostMib_subagent_Makefile" command.
Here is the "ocStbHostMib_subagent_Makefile" file contents:
CC=gcc
TABLE_01_PREFIX=ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable
TABLE_02_PREFIX=ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable
TABLE_03_PREFIX=ocStbHostComponentVideoTable/ocStbHostComponentVideoTable
SCALAR_01_PREFIX=ocStbHostHWIdentifiers/ocStbHostHWIdentifiers
NETSNMPCONFIG=net-snmp-config
# uncomment this if you have GNU make
#NETSNMPCFLAGS := $(shell $(NETSNMPCONFIG) --base-cflags)
#NETSNMPLIBS := $(shell $(NETSNMPCONFIG) --agent-libs)
NETSNMPCFLAGS=`$(NETSNMPCONFIG) --base-cflags`
NETSNMPLIBS=`$(NETSNMPCONFIG) --agent-libs`
LIBS=$(NETSNMPLIBS)
STRICT_FLAGS = -Wall -Wstrict-prototypes
CFLAGS=-I. $(NETSNMPCFLAGS) $(STRICT_FLAGS)
SRCS = ocStbHostMib_subagent.c \
$(SCALAR_01_PREFIX).c \
$(TABLE_01_PREFIX)_data_get.c $(TABLE_01_PREFIX)_data_set.c
$(TABLE_01_PREFIX)_data_access.c $(TABLE_01_PREFIX).c
$(TABLE_01_PREFIX)_interface.c \
$(TABLE_02_PREFIX)_data_get.c $(TABLE_02_PREFIX)_data_set.c
$(TABLE_02_PREFIX)_data_access.c $(TABLE_02_PREFIX).c
$(TABLE_02_PREFIX)_interface.c \
$(TABLE_03_PREFIX)_data_get.c $(TABLE_03_PREFIX)_data_set.c
$(TABLE_03_PREFIX)_data_access.c $(TABLE_03_PREFIX).c
$(TABLE_03_PREFIX)_interface.c
OBJS = ocStbHostMib_subagent.o \
$(SCALAR_01_PREFIX).o \
$(TABLE_01_PREFIX)_data_get.o $(TABLE_01_PREFIX)_data_set.o
$(TABLE_01_PREFIX)_data_access.o $(TABLE_01_PREFIX).o
$(TABLE_01_PREFIX)_interface.o \
$(TABLE_02_PREFIX)_data_get.o $(TABLE_02_PREFIX)_data_set.o
$(TABLE_02_PREFIX)_data_access.o $(TABLE_02_PREFIX).o
$(TABLE_02_PREFIX)_interface.o \
$(TABLE_03_PREFIX)_data_get.o $(TABLE_03_PREFIX)_data_set.o
$(TABLE_03_PREFIX)_data_access.o $(TABLE_03_PREFIX).o
$(TABLE_03_PREFIX)_interface.o
TARGETS=ocStbHostMib_subagent
.SUFFIXES:
.SUFFIXES: .c .o .deps
all: $(TARGETS)
ocStbHostMib_subagent: $(OBJS) ocStbHostMib_subagent_Makefile
$(CC) -o ocStbHostMib_subagent $(OBJS) $(LIBS)
clean:
rm -f $(OBJS) $(TARGETS)
Here is the output of the "net-snmp-config --base-cflags" command:
-g -O2 -Ulinux -Dlinux=linux -I/usr/include/rpm -I/usr/local/include
Here is the output of the "net-snmp-config --agent-libs" command:
-L/usr/local/lib -lnetsnmpmibs -lnetsnmpagent -lnetsnmphelpers -lnetsnmp -ldl
-lrpm -lrpmio -lpopt -lz -lcrypto -lm
** Ok, I see that the library path is set to be "/usr/local/lib", so is this
why compiling the subagent is looking in the "/usr/local/lib" directory?
Why would the "net-snmp-config" command indicate the library path is
"/usr/local/lib" when the "configure" command used to configure the snmpd
master agent included the following option:
"--prefix=/export/home/rosent1/snmp/usr/local"
I would have thought this meant that the library path would be the following
directory location instead:
/export/home/rosent1/snmp/usr/local/lib
Dave Shield <[EMAIL PROTECTED]> wrote: On 12/07/07, Need Help wrote:
> Does this mean that the subagent only looks for library files in the
> "/usr/local/lib" directory or is there a way to inform the subagent code to
> compile using the library files located in the
> "/export/home/rosent1/snmp/usr/local/lib/" directory
> instead?
How are you compiling the subagent?
What is the exact compilation command that is used?
> Perhaps I need to update the "/etc/ld.so.conf" file and type "ldconfig" to
> do this?
If you've got libraries installed in this location, then I'd definitely suggest
updating /etc/ld.so.conf to cover it.
> I would have assumed that the libraries were only required for compilation,
> but I guess I am wrong.
That's right - you are wrong.
The whole point of using shared libraries is that the code is not included
within the application binary directly. Instead, the libraries are picked up
when the application is run (and a single library can therefore be shared
between two or more applications).
When you compile using static libraries ( libwombat.a ), then the library
code is effectively copied into the application binary, and it doesn't then
need the "external" copy to run.
But if you're using shared libraries, then it does.
The command 'ldd' will list what shared libraries (if any) a given application
binary requires, and where it will pick them up from.
Dave
---------------------------------
Yahoo! oneSearch: Finally, mobile search that gives answers, not web links. -------------------------------------------------------------------------
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