Deploying app with sql plugins
-
Hello
I've built an app that works perfect on my development machine (where I have full QT package installed). I decided to test it on the other machine so I've copied all files (including all required dll) to new machine and run the application.What does not work is a MySQL driver. Application runs without any problems, but when I try to connect to database it returns an error saying "Driver not loaded". So I've followed some thread on the forum & docs and copied sqldrivers plugin directory, added path to library paths, but it didn't help.
The App is run from C:/slican.
I think that the file which is required is the one from QT Installation path, so in my case it is:
C:\Qt\5.4\mingw491_32\plugins\sqldrivers\qsqlmysql.dllOn the test machine this file is now copied into:
C:/slican/plugins
C:/slican/sqldrivers
C:/slican/plugins/sqldriversI've checked library paths using this code in the main.cpp:
QApplication a(argc, argv);
QString str = a.applicationDirPath() + "/plugins";
a.addLibraryPath(str);
QString strl = QString("(%1): %2").arg(a.libraryPaths().count()).arg(a.libraryPaths().join(";"));The strl variable is passed to MainWindow to display what paths are checked, here is the strl value:
(2): C:/slican/plugins;C:/slicanAnd when I try to connect to DB it still says that driver was not loaded. Test machine is the newly created virtual machine with windows 10 on board. Do I need to copy any dll somewhere to the windows directory or something?
Can anyone help?Thanks & Regards
Przemek