3

I'm trying to deploy a Qt application on Mac OSX so I'm running this command:

macdeployqt Example.app

It mostly seems to work as the executable grows in size so I assume the relevant plugins and libraries are being added. However, in the end macdeployqt outputs this error message:

ERROR: no file at "/usr/local/pgsql/lib/libpq.5.dylib" 

Does anybody know what this file is? Do I need to install something to make it work?

Charles
  • 50,943
  • 13
  • 104
  • 142
laurent
  • 88,262
  • 77
  • 290
  • 428
  • "'liqpq'" is the PostgreSQL library. Are you including it in your project? And if so, I think you need to copy it to your built application's bundle. – Michael Dautermann Jun 17 '12 at 11:49
  • 1
    @MichaelDautermann, this is strange, I'm not actually using PostgreSQL in my project, just SQlite. Is there any way to remove this dependency? – laurent Jun 17 '12 at 12:00

1 Answers1

4

The documentation states: SQL driver plugins are deployed if the application uses the QtSql module. The macdeployqt tool does not know which plugins your application uses, and tries to deploy all of them. Your application does not link directly with any of the plugins, so there's no way to tell what it uses merely by looking at the executable. The macdeployqt tool would need to parse the code of your application, or use potentially breakable heuristics to scan for sql driver name strings. It's a shortcoming of the macdeployqt tool.

A temporary workaround would be to move the unused plugins out of the plugins/sqldrivers folder in QtSdk.

Note: The Example.app is not an executable. It is an application bundle -- a folder with stuff in it and you can inspect its contents in the usual way: from the shell, or via Finder by right-clicking on the application bundle.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
  • I didn't compile Qt myself, I just installed the one provided on the Qt website. What surprises me is that macdeployqt tries to add this library to the package, yet the app works just fine without it. – laurent Jun 17 '12 at 12:58
  • Thanks a lot for the info and documentation reference. I will try removing the driver from the plugin directory to see if it works. – laurent Jun 23 '12 at 10:56