Re: plugin loading problem
Quote:
Originally Posted by naresh
Q_EXPORT_PLUGIN2(my_plugin, plugin)
TARGET = ../../plugins/plugin
These names must match.
Re: plugin loading problem
I've changed those lines to be same but still can't load it...
Re: plugin loading problem
The Qt plugin classes are really hard to use. Usually you have no idea why loading fails. I noticed that plugins are extremely sensitive to bugs in the .pro files.
If even one of your .h or .cpp files includes a .h which is not in your .pro file, even if not used at all, plugin loading might fail.
I usually even create a fake .cpp file for each interface file to put it in the .pro file.
Re: plugin loading problem
Quote:
Originally Posted by Kumosan
The Qt plugin classes are really hard to use. Usually you have no idea why loading fails.
Never tried it, but "static plugins" might produce linker errors.
Anyway the problem with the above plugin was that the interface wasn't a real interface.
It should be:
Re: plugin loading problem
Hi,
I am busy trying to figure out what goes wrong. I developed some plugins for the qt designer and sometimes it did not load either. To test if a plugin will load, you can do the following:
create a file called main.cpp with just this:
int main(int argc, char* argv[])
{
return 0;
}
then compile (libfirstplugin.so is the plugin you like to test)
g++ test.cpp libfirstplugin.so
In case of your code, I got:
libfirstplugin.so: undefined reference to `typeinfo for PluginInterface'
libfirstplugin.so: undefined reference to `vtable for PluginInterface'
So this is I guess why the plugin is not loading. I am searching for an answer on these messages
1 Attachment(s)
Re: plugin loading problem
Hi,
See attachment, it works now. Maybe you can check if it also works for your application.
Cheers,
Jeroen