Take the 2-minute tour ×

I have created a plugin for my application. If I don't use the GDAL library in my code, my application can use this plugin (QPlugin loads it) and it works fine. But if I use classes from the GDAL library QPluginLoader can't load it and the errorstring() method returns ../serverplugin.dll Can't find module.

There are two exported symbols qt_plugin_instance and qt_plugin_query_verification_data in the plugin DLL (I found them with Dependency walker). QPluginLoader uses the QLibrary class internally to interface with the C symbols exported to the DLL. If I don't use GDAL I have only two exported symbols in all plugins at the beginning. When I use GDAL these two symbols are moved at the end of a big list of exported symbols. Maybe these two exported symbols should be at the beginning.

What am I doing wrong?

share|improve this question
add comment

1 Answer

I had the same problem with QPluginLoader. In few words how I solved it: I create plugin library, let's say lib1.dll which use some stuff from lib2.dll. In my application I try to load lib1 via QPluginLoader.

QPluginLoader loader( adaptersDir.absoluteFilePath(fileName) );
AdapterInterface* adapterIface = qobject_cast<AdapterInterface*>(loader.instance());

In this case loader.instance() returns 0. Solution was to copy lib2.dll into application folder because an application use it for proper load plugin lib1.

share|improve this answer
add comment

Your Answer


