I'm trying to create modular application in C++. Everything works fine when linked statically, but I want to achieve plug-in architecture (using dlopen or LoadLibrary).
All base classes are located in host apllication and these classes are extended in plug-in modules. Modules are loaded at run-time.
Application Module
---------------- -------------------
| BaseClass1 | | ExtendedClass1 |
| BaseClass2 | | ExtendedClass2 |
| BaseClass3 | | ExtendedClass3 |
---------------- -------------------
But when I try to compile module, linker obviously can't find references to BaseClass methods.
Can I somehow tell linker not to link these classes at compile time and let OS to link them on load in run-time? Or should I use different approach and move BaseClasses to some core library and link both the application and module to this core library?