Cant connect to database if application is not opened via QT creator
-
I have used this guide https://wiki.qt.io/Deploy_an_Application_on_Windows in order to deploy my application for another PC. The problem is that my application wont connect to my SQLite database if i start it on another PC. I have copied all the plugins from QT installation including the sql drivers. The interesting thing is if i follow the guide and rename QT installation folder to QTHidden, the application on the development machine also wont connect to the database . So i figure i am missing something from the QT Folder. Any suggestions?
-
Hi
yes, use http://www.dependencywalker.com/
and check the the exe and the sql plugin if it has other
requirements not copied.Alternativ also try with
http://doc.qt.io/qt-5/windows-deployment.htmland see what it copies.
-
-the windeployqt wont start on my machine.
Really ?
What does it say ?Also, just for check. This is a release .exe u are testing with?
Also did u run Walker on the SQL plugin and see if it needs extra?
Its often something like that. -
Did you have a look at http://doc.qt.io/qt-5/windows-deployment.html as suggested by @mrjj?
The windeployqt will copy all neccessary (Qt) dll files and folders into the folder where your compiled exe file is. In case of SQL you will also need the
sqldrivers
folder and the dll file(s) in there. -
-the windeployqt wont start on my machine.
Really ?
What does it say ?Also, just for check. This is a release .exe u are testing with?
Also did u run Walker on the SQL plugin and see if it needs extra?
Its often something like that. -
Did you have a look at http://doc.qt.io/qt-5/windows-deployment.html as suggested by @mrjj?
The windeployqt will copy all neccessary (Qt) dll files and folders into the folder where your compiled exe file is. In case of SQL you will also need the
sqldrivers
folder and the dll file(s) in there. -
@mrjj I double click on the windeployqt, and window shows up for a second, but then it disappears. Yes, this is a release exe
@mardzo said in Cant connect to database if application is not opened via QT creator:
@mrjj I double click on the windeployqt, and window shows up for a second, but then it disappears
It is a commandline tool, so you can not just double click it from the file browser.
-
@mrjj I double click on the windeployqt, and window shows up for a second, but then it disappears. Yes, this is a release exe
@mardzo said in Cant connect to database if application is not opened via QT creator:
I double click on the windeployqt, and window shows up for a second, but then it disappears. Yes, this is a release exe
You should read its documentation and not just double click on it (it is a command line tool not a GUI application).
-
Im sorry guys i have never used it before. But now i did and windeployqt copied the same folder sqldrivers and also the others needed imageformats, platforms etc... I still have the same problem. If a Qt installation is not present, i cant connect to the db
-
Im sorry guys i have never used it before. But now i did and windeployqt copied the same folder sqldrivers and also the others needed imageformats, platforms etc... I still have the same problem. If a Qt installation is not present, i cant connect to the db
-
Im sorry guys i have never used it before. But now i did and windeployqt copied the same folder sqldrivers and also the others needed imageformats, platforms etc... I still have the same problem. If a Qt installation is not present, i cant connect to the db
@mardzo said in Cant connect to database if application is not opened via QT creator:
Im sorry guys i have never used it before. But now i did and windeployqt copied the same folder sqldrivers and also the others needed imageformats, platforms etc... I still have the same problem. If a Qt installation is not present, i cant connect to the db
What does your directory structure look like for your app after windeploy?
It should be something like this:
<root of your app> plugins/ images/ platforms/ sqldrivers/ *.exe *.dll
Then you may also need a qt.conf file with this in the root of your app:
[Paths] Plugins = plugins
That should get you working and connected.