[Qt-interest] Plugin framework
Andreas Pakulat
apaku at gmx.de
Tue Nov 24 00:17:45 CET 2009
On 23.11.09 23:52:40, Tim Peeters wrote:
> My apologies, I only discovered the QPluginLoader::errorString() function
> now.
> So if I include this line:
> if (!loader.load()) cout<<"error:
> "<<qPrintable(loader.errorString())<<endl;
> instead of the cout<<"bla" below, it prints the following error message:
>
>
> error: Cannot load library
> /home/tim/dtibuild/new/bin/libbmia_BogusPlugin.so:
> (/home/tim/dtibuild/new/bin/libbmia_BogusPlugin.so: undefined symbol:
> _ZTV11BogusPlugin)
>
> Unfortunately I still do not know how to solve this :(
Three things that come to my mind when reading your code:
a) no public constructor for BogusPlugin that takes a QObject parent
b) Plugins are usually built with the MODULE flag for add_library so
they don't get the lib prefix on linux
c) Q_EXPORT_PLUGIN2 expects a PluginName as first parameter and its said
this should match the TARGET in the .pro file. So you should probably
use the libraries basename there (i.e. bmia_BogusPlugin, if you use the
MODULE mode)
Andreas
--
Your love life will be... interesting.
More information about the Qt-interest-old
mailing list