[SOLVED]MySQL library problem
-
@mcosta not it doesn't, macdeployqt parses the output of otool to get the dependencies of the libraries/plugins of Qt. AFAICT, the plugins are built with dependencies coming from MacPorts hence the libmysqlclient.18.dylib in /opt/local/lib/
-
You have to give more details. "Doesn't work" doesn't give enough information to help you. Do you have any error message ?
-
Then you have to do
install_name_tool -change /opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib /usr/local/mysql/PATH_TO_libmysqlclient.X.dylib PATH_TO_libqsqlmysql.dylibIn any case, if you are not using it in your application, you can also ignore the message and remove the plugin from the bundle.
[edit: added missing target SGaist]
@SGaist said:
/opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib
install_name_tool -change /opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib /usr/local/mysql-5.6.25-osx10.8-x86_64/lib/libmysqlclient.18.dylib
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool [-change old new] ... [-rpath old new] ... [-add_rpath new] ... [-delete_rpath old] ... [-id name] input -
Which version of OS X and Qt are you using ?
I've corrected the example line
-
OS X 10.10.3
QT 5.4 -
@SGaist said:
PATH_TO_libqsqlmysql.dylib
install_name_tool -change /opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib /usr/local/mysql-5.6.25-osx10.8-x86_64/lib/libmysqlclient.18.dylib Users/jorost/Qt5.4.2/5.4/clang_64/plugins/sqldrivers/libqsqlmysql.dylib
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: Users/jorost/Qt5.4.2/5.4/clang_64/plugins/sqldrivers/libqsqlmysql.dylib (No such file or directory) -
You're missing a slash before Users
-
@SGaist
Now i got only Postgre errorERROR: no file at "/usr/local/lib/libpq.5.dylib"
Does it mean that i have working mysql plugin?
-
You should, unless the libmysqlclient is very different from the one Qt was built with.
-
I have now mysql working, but i still can't have working app because of this:
ERROR: no file at "/usr/local/lib/libpq.5.dylib"This is not very good approach: include all plug-ins w/out need of them.
-
That's the PostgreSQL plugin. Like I suggested before, just remove the plugins you don't need from your bundle.
-
That's the PostgreSQL plugin. Like I suggested before, just remove the plugins you don't need from your bundle.
As i answered before when removing all other plugins from the bundle, the app doesn't open!
-
I didn't suggest to remove all other plugins, just the SQL related plugins you don't use
-
@SGaist Exactly, i left only sqlite plugin and the app doesn't open
-
Start it from the command line, what does it tell you ?
-
@SGaist Strangely the ERROR disappear and working app bundle was created w/out changing anything.Unfortunately the app created database.db in the path i set (in this case in the program.app/contents/MacOS but can't write inside!
Starting the app from QT can write in to the db, but starting it outside Qt doesn't write, but creates it.
-
You need to use a writable path (look at QStandardPaths) Writing in the bundle itself is not something to do and it's even prohibited if you use the App Store to distribute your application.
-
You need to use a writable path (look at QStandardPaths) Writing in the bundle itself is not something to do and it's even prohibited if you use the App Store to distribute your application.
Do you tell me that Qt Desktop application can be submitted in Apple App Store?As i know they don't allowed external frameworks?
-
Yes, you can, they have restriction but no, external frameworks are not prohibited.