I read all I can and posted other questions in different places before, but I cannot get Qt plugins to work.
I made a really simple example (attached) and it doesn't work. Could someone tell me what's wrong?
I read all I can and posted other questions in different places before, but I cannot get Qt plugins to work.
I made a really simple example (attached) and it doesn't work. Could someone tell me what's wrong?
QPluginLoader returns NULL when I open the plugin.
If I'm not mistaken Q_EXPORT_PLUGIN should be in the cpp file and not in the header file. Furthermore the name exported has to correspond with the plugin target name, in your case it should be "test-plugin" and not "mytestplugin".
MTK358 (18th April 2011)
Finally, it works!
I just wish I didn't have to ask over 10 times in different places over the last few weeks to find this out...
The documentation for Q_EXPORT_PLUGIN advises that this macro is deprecated and directs you to use Q_EXPORT_PLUGIN2. The information regarding placement of the Q_EXPORT_PLUGIN2 macro in the implementation file is in the Qt documentation for Q_EXPORT_PLUGIN2 (See QtPlugin).
I used Q_EXPORT_PLUGIN2.
Bookmarks