[Sorry, I m not able to log onto the libtool site at present.] Let me try again.
I would like to dynamically load C libraries and use them. I am attempting to use libltdl for this purpose as I prefer a cross/multi-platform solution. I am attempting to follow "How to use libltdl in your programs". My minimal example is ["test.c"]: /*=============vvvv==============*/ #include <ltdl.h> int main() { int init_status; LTDL_SET_PRELOADED_SYMBOLS(); init_status = (int)lt_dlinit() ; return( lt_dlexit() ); } /*=============^^^==============*/ Using the flags of the runtime build [I did not write the runtime] yields: >> gcc -g -O2 -DNDEBUG -O3 -Wall -DDYNAMIC_LOADING_SUPPORTED -rdynamic -o test -lgmp -lm -ldl -lltdl test.c /tmp/ccG6urRv.o: In function `main': /usr/local/src/FFI/test.c:4: undefined reference to `lt_preloaded_symbols' collect2: ld returned 1 exit status I see nothing in http://www.gnu.org/software/libtool/manual.html#Dlpreopening which leads me to a solution which works [I did try adding "-export-dynamic" with the same result]. Again, I typically use dynamic languages (Scheme, Smalltalk, Dylan, CommonLisp) and it has been some years since I have programmed in C. I am writing this code to build a "foreign function interface" so that I can write code which dynamically loads and uses C libraries but does not require invocation of a C compiler. My eyes glaze over after reading several screens of gcc flag definitions, so my understanding their use is pretty basic. I would appreciate a working example here. Thanks again for any help, -KenD ======================================= On Monday 28 January 2008 11:12:44 am Peter O'Gorman wrote: > Update of sr #106237 (project libtool): > > Status: None => Invalid > Assigned to: None => pogma > Open/Closed: Open => Closed > > _______________________________________________________ > > Follow-up Comment #1: > > Please see http://www.gnu.org/software/libtool/manual.html#Dlpreopening > > It should fix your issue, if not feel free to bring it up again on > libtool@gnu.org > > > _______________________________________________________ > > Reply to this item at: > > <http://savannah.gnu.org/support/?106237> > > _______________________________________________ > Message sent via/by Savannah > http://savannah.gnu.org/ _______________________________________________ http://lists.gnu.org/mailman/listinfo/libtool