Hi, I am having an unexplained behaviour using Qt 4.7.3 and Qt Creator 2.2.1 on Windows 7 (everything works fine on Ubuntu 10.10 and Mac OS X 10.6 using the same versions of Qt and Qt Creator).

Basically, my application relies on various plugins being loaded upon starting my application. Now, for some weird reason, there is one out of 10 plugins that doesn't load when running my application from outside Qt Creator while if I start my application from within Qt Creator, then the plugin loads fine! This is the case whether I build a debug or release version of my application.

As I said, everything works fine on Linux and Mac OS X, so I am really puzzled as why that particular plugin doesn't load. Why that plugin?!

I know it might be a very long shot, but is there something trivial that I might have overlooked?

Here is some code that I use (before actually loading the plugin) to retrieve some information about the plugin itself:

Qt Code:
  1. PluginInfo Plugin::info(const QString &pPluginFileName)
  2. {
  3. // Return the information associated to the plugin
  4.  
  5. PluginInfo pluginInfo;
  6.  
  7. typedef PluginInfo (*PluginInfoFunc)();
  8.  
  9. PluginInfoFunc pluginInfoFunc = (PluginInfoFunc) QLibrary::resolve(pPluginFileName,
  10. QString(name(pPluginFileName)+"PluginInfo").toLatin1().constData());
  11.  
  12. if (pluginInfoFunc)
  13. // The plugin information function was found, so we can extract the
  14. // information we are after
  15.  
  16. pluginInfo = pluginInfoFunc();
  17. else
  18. {
  19. // The plugin information funciton couldn't be found which means that
  20. // we are not dealing with an OpenCOR plugin
  21.  
  22. pluginInfo.type = PluginInfo::Undefined;
  23.  
  24. if (!name(pPluginFileName).compare("CellMLModelRepository")) {
  25. QLibrary lib(pPluginFileName);
  26.  
  27. if (lib.load())
  28. QMessageBox::information(0, QString("Info"), "Can load...");
  29. else
  30. QMessageBox::information(0, QString("Info"), QString("Can NOT load... [%1 | %2]").arg(pPluginFileName,
  31. QFileInfo(pPluginFileName).exists()?"YES":"NO"));
  32. }
  33. }
To copy to clipboard, switch view to plain text mode 
So, what happens is that I am trying to resolve a function which should be in my plugin. In all cases, it works but for that CellMLModelRepository plugin of mine. Having added some debug code, if the function cannot be found, I try to load the plugin using QLibrary which here fails for my CellMLModelRepository plugin even though QFile::exists() does report that the file exists...