This is the test project dynamic module GNU autotools exemplar to explain by doing a small simple project that uses autotools to construct a working, complete program dynamically loading a shared library module and executing code within it.
The property herein remains in right of the original owners with whatever terms they deemed fit to demand. All I did was analyze many conflicted and incomplete technical sources (see attached .pdf files for examples) and make them work. It's what I do.
Original content owners include:
http://web.mit.edu/gnu/doc/html/libtool.html#SEC17
http://man7.org/linux/man-pages/man3/dlopen.3.html
https://autotools.io/libtool/symbols.html
If my 5 hours of work saves you one, please pass that time on. Hug your kids.
David Ryan Erickson @daemondave