Qt plugin API and kdreports library
-
wrote on 22 Jul 2011, 09:39 last edited by
Hello,
I plan to use the GPL version of "KDReports":http://kdab.com/kd-reports library to generate reports in my application. All the functionnalities of my application are provided by plugins. After compiling the KDReports library, when I link one of my plugins with the KDReports library, this plugin is not recognized as a plugin.
If someone had a similar problem or know something about it, please explain to me.
Thanks -
wrote on 22 Jul 2011, 18:38 last edited by
Nobody can help me ?
-
wrote on 22 Jul 2011, 18:49 last edited by
Please be patient. All responses here are from volunteers who are working on their own time. If someone has knowledge in the area you need help with, I'm sure they will respond as soon as they can.
In the mean time, can you provide more information, such as any error messages, platform type, versions of software, or any other data that might help someone understand the specifics of your problem more clearly, please?
Thanks!
-
wrote on 22 Jul 2011, 18:56 last edited by
Did you follow the tutorials provided?
bq. KD Reports comes with a manual that provides tutorials and references. Also, examples are part of the source code that can be customized and used.
bq. Everything Included
KD Reports licenses include:
The full source code.
A Reference Manual.
A Programmer’s Manual with step-by-step tutorials. -
wrote on 23 Jul 2011, 11:12 last edited by
I followed the tutorials. My problem is that when I link my plugin with kdreports library, my plugin is not recognized as a plugin by the core application. Below is the function which load the plugins
@
...
foreach(QString fileName, pluginsDir.entryList(QDir::Files))
{
QPluginLoader loader(pluginsDir.absoluteFilePath(fileName));
QObject *plugin = loader.instance();if(!plugin) qDebug() << "Not a plugin"; else { PxPluginInterface *pxPlugin = qobject_cast<PxPluginInterface*>(plugin); if(pxPlugin) m_pluginsList << pxPlugin; }
}
@After linking with kdreports library, I always have the message "Not a plugin" and I don't have access to the plugin functionnality, but if I unlink with kdreports, the application works well.
I'm using the latest QtSDK on Mac OS X Snow Leopard. I had the same problem on GNU/Linux(Fedora).
-
wrote on 23 Jul 2011, 16:14 last edited by
I have only the message
@"Cannot load library ..."@ -
wrote on 24 Jul 2011, 10:11 last edited by
Have you tried stepping into the QPluginLoader constructor and the instance method?
(Don't forget to setup the correct Qt source pathes in Qt Creator). -
wrote on 24 Jul 2011, 10:23 last edited by
Sorry, I don't understand what you mean. Stepping into with the debugger ?
And to setup the correct Qt source paths in Qt Creator -
wrote on 24 Jul 2011, 10:46 last edited by
Just place a breakpoint at line #4 and then step through to find out what's going wrong.
For having the Qt sources displayed correctly during debug you might have to install (SDK Maintainance Tool) and setup the Qt sources within Qt Creator (somewhere Options -> Debugger -> Source Pathes).
-
wrote on 24 Jul 2011, 13:54 last edited by
Can the system dynamic linker resolve the kdreports library location when trying to load your plugin?
-
wrote on 25 Jul 2011, 15:44 last edited by
Thanks, the system effectively didn't resolve the kdreports library. But I added the path to kdreports to DYLD_LIBRARY_PATH
@export DYLD_LIBRARY_PATH = ...@
I have to copy the library in /usr/lib before the application works. -
wrote on 25 Jul 2011, 16:59 last edited by
Glad to hear it is resolved.
1/13