我尝试使用以下代码加载我的插件:
QString path = QFileDialog::getOpenFileName(0);
QPluginLoader loader(path);
AnprPluginInterface *i = qobject_cast< AnprPluginInterface* >(loader.instance());
if (i == NULL )
QMessageBox::information(0, "this", "error loading plugin." + loader.errorString());
else
QMessageBox::information(0, "this", "plugin loaded.");
我将插件的绝对路径发送到,QPluginLoader
但它说找不到插件!
错误是:
error loading plugin. "Cannot load library The specified module could not be found."