I don’t maintain the C++ dlopen mini HOWTO any more. I last updated it in 2006, so there are likely better ways to do what you want to achieve by now.

You can find a copy at https://tldp.org/HOWTO/C++-dlopen .