[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Optional shared libraries system



Paul Wise wrote:
> We were discussing optional libraries on IRC and noticed the Solaris
> libc supports this but I can't find any reference to that for glibc.

You can do something very similar with weak symbols.  You don't even
need to use dlopen to test for their existence; you can just test the
symbol directly to check for NULL, or you can supply your own version
that'll be used if you don't have the shared library.  You do still have
to load the library yourself, though, at which point you might as well
use that as the "did I find it" test.

- Josh Triplett


Reply to: