PDA

View Full Version : Common classes between main application and plugins



NaOH
22nd October 2012, 00:05
Hello everyone!

Well, I'm trying to make an application that loads different plugins to give it different functionalities. My problem arises when I try to share a class between my main application and its plugins. I mean, in the main application I have a header file where I define a class and another file for its implementation. What I want to do is to give the plugin access to this very same class, so what I tried was to simply include the headers in my plugin code (the include directory was already set in order to be able to include the "interfaces.h" where the plugin interface is defined). It gives no problems, and I can use objects from this class and call the functions that it inherits from other Qt classes, but as soon as I try to call a function member from the class it gives this error: symbol lookup error: /home/santiago/Qt/StraK/plugins/libeighttracksplugin.so: undefined symbol: _ZN11borderImage8setAlphaEi. I guess this has to do with a linking problem, but I can't figure out how to solve it.

Thanks in advance for your help!

StrikeByte
22nd October 2012, 10:49
Can u give us some code, and mark where the error occurs?

wysota
22nd October 2012, 11:35
The proper way to do it is to export all shared classes and functions into a shared library that is linked by both the main application and the plugins.