View Full Version : QPluginLoader instance

22nd November 2007, 07:30

I am new to Qt, and I am trying to write a plugin for one application following the Plug and Paint example with VC2005 and Qt 4.2. Everything works fine first, but when I want to link the plugin with a external libary(complied by VC2003, I have the includes files, *.lib and *.dll), the plugin becomes 0 after loader.instance() in the source code below, any helps or hints on this issue? I can not compile and control the external libary.

foreach (QString fileName, pluginsDir.entryList(QDir::Files)) {
QPluginLoader loader(pluginsDir.absoluteFilePath(fileName));
QObject *plugin = loader.instance();

22nd November 2007, 07:47
See here:


As the plugin has been built using a different compiler than Qt, it will not be loaded.