Building QT with "windeployqt": not connect to database (ODBC)
-
Hello, and sorry for my not perfect English.
I developed a simple UI application with QT, connected to a local database (using XAMPP). I downloaded the ODBC connector (https://dev.mysql.com/downloads/connector/odbc) and configured the connection to the database through ODBC Data Sources. In the main I connect to the database and everything works correctly.
Then I generated the executable of my project and related dependencies using the windeployqt command from terminal. I put all in the same folder and the executable works perfectly.
Then I moved everything (exe + dependencies) to another PC (with the same database locally and xampp running), but here the connection to the database fails.
How can I solve it? Thanks!
-
Hi and welcome to devnet,
Did you check that you also deployed the connector's dll and its dependencies along with your application ?
-
Use a tool like Dependency Walker to find the direct dependencies you need to deploy.
-
This is for your application executable, you should check the database plugin.
-
Eventually, this is the output:
These are already present:
- LIBGCC_S_DW2-1.DLL
- LIBSTDC++-6.DLL
- QT5CORE.DLL
- QT5SQL.DLL
I downloaded the other 3 [https://www.dll-files.com/search.dll.html], and added these in the same folder.
-
And the ODBC dll ?
-
Yes, did you check the dependencies of that one ?