[Qt-interest] Extending QT application - some design question
Andreas Pakulat
apaku at gmx.de
Tue Oct 6 18:19:42 CEST 2009
On 06.10.09 15:09:05, jjDaNiMoTh wrote:
> Hello to all,
> I've read the second part of the plugin how-to [1], where it explains how
> expand qt application through plugin. Now I've created my first test app,
> with a MainWindow that load some plugins (like the EchoPlugin example).
>
> Now, if I try to define in the MainWindow class a test method ( foo() ) and
> try to execute it from plugin, the linker fails, saying the undefined
> reference of foo(). I can link togheter the MainWindow.o object file with
> the plugin object file, but in this way the plugin architecture doesn't make
> sense ( the MainWindow load a plugin that have linked another MainWindow
> object file ?!? ).
>
> So, I want to make a plugin that use some already-defined functions, that
> live on another part of the program, without linking the plugin itself with
> the object that have the already-defined functions.
>
> Is right my design model, or a plugin can't never never call an external
> function, but implements only what the MainWindow (in this case) want?
What you should do in this case is create a shared library to which both
the plugin and your main executable link and which provides the functions
that the plugin wants to use.
Andreas
--
A long-forgotten loved one will appear soon.
Buy the negatives at any price.
More information about the Qt-interest-old
mailing list