Automatically Creating Wrappers for Classes Loaded with dlopen()
I'm writing a proxy class that loads a shared library with dlopen() and forwards its member functions to the appropriate members of the proxied class instance inside the loaded shared object behind the scenes. For example, the shared object has a Person class: class Person { ... void setName(std::string name); }; I've added a wrapper file that includes the person.h header and defines the following symbol: extern "C" { void Person_setName(void* instancePointer, std::string name); } This call just forwards to the person object which is the first argument, extern "C" to avoid the whole name