On Tue, 17 Apr 2007, Ralf Wildenhues wrote:
If you can find out the set of libraries at 'configure' time, then there
is no need for dlopen.
There is in my case: I do know the set of libraries at configure time, but I
can't link against all of them. The particular case I have in mind is
building a Debian package that can go in main but use libraries that are not
distributed in main. I can't link normally against such libraries (as that
would make the package depend on them, and a package in main can't depend on
a package not in main).
Doing this fully automatically does not work on any system I know of.
AIX in some cases allows startup with some symbols not yet defined, but
that's pretty obscure. I don't think it works with libs that may or may
not be present, though.
I don't want symbols to be undefined at startup, I want something (the
linker? libtool?) to convert symbol references into indirect references via
pointers initialised at runtime by libdl/libltdl.
The use I have in mind is linking CODECs with different licenses into an
application without needing to change the code so that the CODECs are
dlopened. Then, if certain CODECs are not available, the application can
simply give an error message if the user attempts to use them, but the
application author doesn't need to write (or in this case, re-write) the
code to use dlopen.
This is the typical application for dlopen/lt_dlopen.
Indeed, but I'd rather not have to rewrite modules into this form by hand,
in particular because for other uses the code can be linked normally, and I
don't want to depend on libdl/libltdl if I can avoid it.
(The code I have in mind is SoX (sox.sf.net).)
http://rrt.sc3d.org/ | taciturn, n. a silent pot