Thanks, that problem is now fixed, but i still can't seem to load my plugin.
K Fixed the problem that was stated below. Forgot the Q_EXPORT_PLUGIN2 line.
When i try to load the plugin i get the error:
Qt Code:
"The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/scrapperplugind.dll' is not a valid Qt plugin."To copy to clipboard, switch view to plain text mode
I load the plugins with the following code:
Qt Code:
ui(new Ui::MainWindow) { ui->setupUi(this); qDebug() << pluginsDir; { qDebug() << filename; qDebug() << pluginsDir.absoluteFilePath(filename); qDebug() << pluginLoader.errorString(); if (plugin) { qDebug() << "2"; scrapperInterface = qobject_cast<ScrapperInterface *>(plugin); if(scrapperInterface) { qDebug() << "3"; } } } }To copy to clipboard, switch view to plain text mode
which gives the following output:
Qt Code:
"main.o" "G:/projects/DuneInterface-build-desktop/movieWall/debug/main.o" "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/main.o' is not a valid Qt plugin." "mainwindow.o" "G:/projects/DuneInterface-build-desktop/movieWall/debug/mainwindow.o" "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/mainwindow.o' is not a valid Qt plugin." "moc_mainwindow.cpp" "G:/projects/DuneInterface-build-desktop/movieWall/debug/moc_mainwindow.cpp" "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/moc_mainwindow.cpp' is not a valid Qt plugin." "moc_mainwindow.o" "G:/projects/DuneInterface-build-desktop/movieWall/debug/moc_mainwindow.o" "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/moc_mainwindow.o' is not a valid Qt plugin." "movieWall.exe" "G:/projects/DuneInterface-build-desktop/movieWall/debug/movieWall.exe" "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/movieWall.exe' is not a valid Qt plugin." "scrapperplugind.dll" "G:/projects/DuneInterface-build-desktop/movieWall/debug/scrapperplugind.dll" "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/scrapperplugind.dll' is not a valid Qt plugin." G:\projects\DuneInterface-build-desktop\movieWall\debug\movieWall.exe exited with code 0To copy to clipboard, switch view to plain text mode
Here scrapperplugind.dll is the plugin i wish to load.
I was looking the code while debugging and think i found why it doesn't work.
In the isPlugin function Qt loads the settings from the library and should load with which version of Qt it is build. But it doesn't find that information and i don't know why.
Bookmarks