Hi, I am trying to make my application as modular as possible by having everything as a plugin. Some of my plugins are self-contained (e.g. plugin A) while others are dependent on other plugins (e.g. plugin B depends on plugin A, more precisely B uses resources and classes which are defined in A).
Before building A and B as 'proper' plugins, I thought I would first build them as 'pure' shared libraries (note: in case it matters, I use CMake not QMake), and everything builds as expected and I can load A and B using QLibrary. If I use QPluginLoader, then obviously I get told that A and B are not Qt plugins.
The next step was for me to make A and B 'proper' plugins. I thought I would start with A and disable B, so that I could test the loading of A using QPluginLoader, and indeed everything works as expected and I can load A using QPluginLoader. Next, I made B a 'proper' plugin, but this time round it doesn't build... I get several undefined references to classes that are defined in A and which I need in B.
Now, could it be that I overlooked something? If so, what could it be? As I said, if I remove the plugin-specific side of things (i.e. Q_EXPORT_PLUGIN2) then everything builds and loads fine.
Bookmarks