Hi everybody, I am trying to use libtool and libltdl to develop a C++ library (named Ceylan) that provides some services, including plugin support. Despite the reading of libltdl documentation and of the autobook, I am facing link problems with the unit test (testCeylanPlugin) for plugin support (test plugin is ceylan-test-plugin.la, it would need some other services provided by libCeylan.la), as if the STL symbols could not be found despite the various flags :
""" creating .libs/testCeylanPluginS.c generating symbol list for `testCeylanPlugin' extracting global C symbols from `testCeylanPlugin.o' [..] g++ -g -ggdb -O0 -fno-inline -Wall -Werror -Woverloaded-virtual -W -Wfloat-equal -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wpacked -Wredundant-decls -Wno-unused-parameter -ansi -pedantic-errors -o .libs/testCeylanPlugin .libs/testCeylanPluginS.o testCeylanPlugin.o -Wl,--export-dynamic -L/home/sye/tmp-Ceylan-test-install/lib -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib -L/usr/lib/gcc-lib/i686-pc-linux-gnu/../../../i686-pc-linux-gnu/lib ./.libs/ceylan-test-plugin.so /home/sye/tmp-Ceylan-test-install/lib/libCeylan.so /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/libstdc++.so -lm -lgcc_s -lc /home/sye/tmp-Ceylan-test-install/lib/libltdl.so -ldl -lpthread -Wl,--rpath -Wl,/home/sye/tmp-Ceylan-test-install/lib .libs/testCeylanPluginS.o:(.rodata+0x3044): undefined reference to `std::_Base_bitset<(unsigned)1>::_M_do_find_next(unsigned, unsigned) const' .libs/testCeylanPluginS.o:(.rodata+0x304c): undefined reference to `std::_Base_bitset<(unsigned)1>::_M_do_find_first(unsigned) const' .libs/testCeylanPluginS.o:(.rodata+0x30c4): undefined reference to `std::__enc_traits::_S_max_size' .libs/testCeylanPluginS.o:(.rodata+0x3314): undefined reference to `__gnu_cxx::facet_name' .libs/testCeylanPluginS.o:(.rodata+0x331c): undefined reference to `__gnu_cxx::messages_c' . [...] """" (one thing I do not understand is why "/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/libstdc++.so" is specified this way, I would have expected "-L/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6 -lstdc++"; I tried to run that command manually but the link error remained) In configure.in I have indeed """ AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL """ but libtool says : """ *** Warning: Linking the executable testCeylanPlugin against the loadable module *** ceylan-test-plugin.so is not portable! libtool: link: warning: `AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support. """ In my Makefile.am I have : """ testCeylanPlugin_SOURCES = testCeylanPlugin.cc testCeylanPlugin_LDFLAGS = -export-dynamic -no-undefined -dlpreopen force -dlopen self -dlopen ceylan-test-plugin.la testCeylanPlugin_LDADD = $(LIBLTDL) testCeylanPlugin_DEPENDENCIES = $(LIBLTDL) ceylan-test-plugin.la lib_LTLIBRARIES = ceylan-test-plugin.la ceylan_test_plugin_la_SOURCES = ceylan-test-plugin.cc ceylan_test_plugin_la_LDFLAGS = -no-undefined -module -avoid-version """ I tried various combinations (specifying convenience/installable libltdl, declaring the plugin with extern "C", using a pure-C plugin, playing with the numerous link options in Makefile.am) with no luck for the moment. Does anybody have a clue, or know the proper way to set up this ? Thanks in advance, regards, Olivier. PS: the desired layout would be : libCeylan (which is C++) can load any plug-in, including C++ ones, including plug-in needing some services provided by libCeylan and the STL _______________________________________________ http://lists.gnu.org/mailman/listinfo/libtool