2

I am trying to deploy a Qt application that uses SQLite on OS X. I simply ran the command:

macdeployqt MyApplication.app -dmg

and I get the following error:

ERROR: no file at "/opt/local/lib/mysql55/lib/libmysqlclient.18.dylib"

I already read about SQLite plugin on this link but I could not understand how it works.

Note: I have a folder: ......./Qt5.3.2/5.3/clang_64/plugins/sqldrivers/

that contains:

libqsqlite.dylib

libqsqlite_debug.dylib

and some other libs related to other sql drivers.

Any idea how can I solve this?

Thanks

KelvinS
  • 2,870
  • 8
  • 34
  • 67
  • 1
    You are talking about SQLite, but the error you got is about MySql plugins. Are you linking your application in your PRO file against MySql libs? Maybe you have added MySQL support in PRO file? Try to find out why your binary is linked against MySQL and remove the reason of this. – Max Go Feb 11 '17 at 07:16
  • I had a similar error from macdeployqt, in the end I chose to simply ignore it because my deployed app worked just fine. The root of the problem might be in QtSql having MySQL as a dependency but as long as you don't actually use any MySQL stuff, there's a chance you'll be fine. – Dmitry Feb 11 '17 at 10:12
  • However, in my case I deployed just .app, not .dmg... So it might be impossible to ignore the error if you want to produce a .dmg with macdeployqt. – Dmitry Feb 11 '17 at 10:15
  • @Max Go: no, I'm not using MySQL, in my PRO file I am just setting this: `QT += sql`. – KelvinS Feb 11 '17 at 12:28
  • @Dmitry, actually, even showing the error message the DMG file was successfully generated, and it seems to be working fine. I tested the application on my machine and on a virtual machine and it seems to work correctly. Should I just ignore the error message? – KelvinS Feb 11 '17 at 12:30
  • It looks like your options are to either ignore the error or to find out the exact source of MySQL dependency, to know for sure whether it's totally safe to ignore it :) – Dmitry Feb 11 '17 at 13:07

1 Answers1

1

As SGaist answer here:

macdeployqt deploys all the plugins by default since it doesn't know which one you'll be using.

Note that you can build the .dmg in two steps, first run macdeployqt, then remove all the unused Sql plugins and then create the image.

It means that if I am not using MySQL in my application I can just ignore this error message.

Community
  • 1
  • 1
KelvinS
  • 2,870
  • 8
  • 34
  • 67