GNU Autoconf, Automake, and Libtool
by Gary V. Vaughan, Ben Elliston, Tom Tromey, Ian Lance Taylor
16.3. Finding a Module
When you are writing a program that will load dynamic modules, a major stumbling block is writing the code to find the modules you want to load. If you are worried about portability (which you must be, or you wouldn't be reading this book!), you can't rely on the default search algorithm of the vendor dlopen function, because it varies from implementation to implementation. You can't even rely on the name of the module, because the module suffix varies according to the conventions of the target host (although you could insist on a particular suffix for modules you are willing to load).
Unfortunately, this means that you will need to implement your own searching algorithm and always use an absolute path name when you call ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access