MySql Deploy App....HELP!!
-
Hi, I'm guessing, windeployqt is a fine tool but for database programs it forgets to copy Q5Sql.dll, that could be cause of your problem. When starting windeployqt, try adding the -sql switch, like this:
windeployqt -sql yourapp.exe
@hskoglund Thanks for the reply but QT5Sql.dll it did copy QT5Sql.dll into the application directory.
-
Hi and welcome to devnet,
Do you also have the MySQL client libraries deployed with your application ?
-
Ok. You could try debugging, turn on a trace when Qt loads the plugins.
Before starting your app, set an environment variable to enable the trace:
SET QT_DEBUG_PLUGINS=1
To see the trace output, you can download the DebugView program
-
Hi and welcome to devnet,
Do you also have the MySQL client libraries deployed with your application ?
-
Don't put anything in the windows folder. Next step is what @hskoglund suggested
-
The question is going to be silly but: Are you instantiating a QApplication (or Gui or Core) as the first thing in your main function ?
-
Can you check what QCoreApplication::libraryPaths(); returns ?
-
Hi, one more thing you could try (since your app runs fine when launched from Qt Creator):
define the environment variable (SET QT_DEBUG_PLUGINS=1) also in Qt Creator (in the Projects Tab, you can set it in Build Environment) then start your app and compare the trace output to the one you got with errors before. -
Here's another: try skipping using windeployqt; instead switch to using manual deployment, use this nice guide
-
Here's another: try skipping using windeployqt; instead switch to using manual deployment, use this nice guide
@hskoglund Ok tried it Same Thing!!
-
@shathcock Nope same thing!!!
-
Hmmmm, if I understand correctly: you have 2 directories/folders with identical contents but in different places on your C: drive. When you doubleciick to launch your app in one of them everything is fine and dandy, but when you try doubleclicking your app in the other directory you get that mysql plugin loading error?
-
Hmmmm, if I understand correctly: you have 2 directories/folders with identical contents but in different places on your C: drive. When you doubleciick to launch your app in one of them everything is fine and dandy, but when you try doubleclicking your app in the other directory you get that mysql plugin loading error?
@hskoglund Basically yes. The one directory that is does run out of is the one that it is placed into when it is compiled, in other words the build..........\release folder. When I move the app.exe file and try to build a distribution folder it just all falls apart. The app actually runs but no database connection. I will say this also I spent 3 days with it not running until I set the environment variable QT_QPA_PLATFORM_PLUGIN_PATH. Could that be the problem. Sorry my brain is fried from trying to figure this stuff out.
-
Aha, I see :-)
TheQT_QPA_PLATFORM_PLUGIN_PATH
fiddling explains why in that debug trace above there are no database dlls listed, because Qt is barking up the wrong tree I mean directory. (Because while settingQT_QPA_PLATFORM_PLUGIN_PATH
takes care of custom loading qwindows.dll from a directory of your choosing, it leaves other plugins like database guys stranded.)QSalDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers; <-- no DLLs listed here
QSqlDatabase: an instance of QCoreApplication is required for loading driver pluginsSo try placing the directory sqldrivers next to your .exe file, that should do it (just copy it from C:\5.5\msvc2013\plugins)