[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-coders
Subject:    Linkear a dynamic module to a dynamic library
From:       Juan_Bússoli <juanbussoli () gmail ! com>
Date:       2013-10-25 20:36:27
Message-ID: CAOdOf4QcB=OsLVVTiJPiWWdWgLnRC6M83TjdAPocgMhDdzcP6w () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

I am trying to create a dynamic module for SNMP, which needs use some
functions that are in a dynamic library. To compile the module, I have
modified the Makefile that you provide me in the tutorial "Writing a
Dynamically Loadable Object", as result I got some thing like this:

CC=gcc

all: ./$(MODULE_NAME).c Makefile
$(CC) $(INCLUDES) $(INC_MODULES) $(CFLAGS) $(DLFLAGS) -L $(API_ROOT_DIR)
-Bdynamic -l $(API_ROOT_DIR)/libdinamic.so  -c -o ./$(MODULE_NAME).o
./$(MODULE_NAME).c
$(CC) $(CFLAGS) $(DLFLAGS) -o ./$(MODULE_NAME).so ./$(MODULE_NAME).o

The file "libdinamic.so" is the dynamic library that I intend to link to my
dynamic module. When i do "make", the build is successful. However, when i
try to load the dynamic module it throws the following error:

undefined symbol: my_drvr_load       error

"my_drvr_load" is a function inside the dinamic library. How could I do
this correctly? From already, thank you very much.

Regards,
Juan

[Attachment #5 (text/html)]

<div dir="ltr"><div><div>Hello,</div><div><br></div><div>I am trying to create a \
dynamic module for SNMP, which needs use some functions that are in a dynamic \
library. To compile the module, I have modified the Makefile that you provide me in \
the tutorial &quot;Writing a Dynamically Loadable Object&quot;, as result I got some \
thing like this:</div> \
</div><div><br></div><div><div>CC=gcc</div><div><br></div><div>all: \
./$(MODULE_NAME).c Makefile<br></div><div><span class="" \
style="white-space:pre">	</span>$(CC) $(INCLUDES) $(INC_MODULES) $(CFLAGS) $(DLFLAGS) \
-L $(API_ROOT_DIR) -Bdynamic -l $(API_ROOT_DIR)/libdinamic.so  -c -o \
./$(MODULE_NAME).o ./$(MODULE_NAME).c</div> <div><span class="" \
style="white-space:pre">	</span>$(CC) $(CFLAGS) $(DLFLAGS) -o ./$(MODULE_NAME).so \
./$(MODULE_NAME).o</div></div><div><br></div><div>The file &quot;libdinamic.so&quot; \
is the dynamic library that I intend to link to my dynamic module. When i do \
&quot;make&quot;, the build is successful. However, when i try to load the dynamic \
module it throws the following error:<br> </div><div><br></div><div>undefined symbol: \
my_drvr_load       error<br></div><div><br></div><div><div>&quot;my_drvr_load&quot; \
is a function inside the dinamic library. How could I do this correctly? From \
already, thank you very much.</div> \
<div><br></div><div>Regards,</div><div>Juan</div></div><div><br></div><div><br></div></div>




------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic