PDA

View Full Version : Qt MySQL drivers deployed with the application



manaila
30th April 2012, 16:36
Hi,
I have my qt application that I want to deploy. The application works fine in the development PC but when I want to run it in another PC where qt is not installed its unable to load mysql drivers. I have read http://doc.qt.nokia.com/4.7-snapshot/deployment-windows.html for deploying my app in windows environments. The problem is with mysql drivers!
I have placed libmysql.dll and /sqldrivers/ folder (which contains mysql drivers) in the /plugins folder which is in the same directory as my app as indicated in the above link.
In the development PC, mysql is installed in C:\MySQL\ but in other PCs, it is in C:\Program Files\MySQL\; can these be the reason. How can I make my deployed app be able to load mysql drivers?

ChrisW67
30th April 2012, 22:19
You need to deploy the Qt MySQL plugin into the "sqldrivers" subdirectory (name is something like qsqlmysql.dll). This is in addition to the MySQL library that the plugin will depend on. See here (http://www.qtcentre.org/threads/46927-Location-of-imageformats-directory?p=211945#post211945) for a picture of what your deployment should look like.

Also, Dependency Walker (http://www.dependencywalker.com/) can be useful in determining what is missing.

manaila
3rd May 2012, 13:15
Thank you, it worked!