PDA

View Full Version : newbie's question: Can't see QMYSQL driver, libqsqlmysql.dylib on Mac OS X 10.6



abdol
22nd May 2011, 05:40
Hi every one, This is my 1st post on this forum. I am new to Qt :o
I just recently installed mysql and decided to try some db stuff. I went through all required procedures and made libqsqlmysql.dylib file without error(s). This is the output of otool:

libqsqlmysql.dylib:
libqsqlmysql.dylib (compatibility version 0.0.0, current version 0.0.0)
libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0)
/opt/local/lib/libQtSql.4.dylib (compatibility version 4.7.0, current version 4.7.3)
/opt/local/lib/libQtCore.4.dylib (compatibility version 4.7.0, current version 4.7.3)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)

then I copied libqsqlmysql.dylib to /Developer/Applications/Qt/plugins/sqldrivers/

printing qDebug()<<QSqlDatabase::drivers(); in the terminal gives me:
("QSQLITE", "QODBC3", "QODBC")

I can't see "QMYSQL" there. My questions are:
1- According to otool, did I miss anything or these versions are compatible?
2-Did I copied the libqsql... to a correct path.
3-How can I resolve this issue?

Please accept my apology if this question is not posted in appropriate category (I am completely new to Qt, Mac and your forum). Thank you so much.

larcho
3rd August 2011, 23:22
I don't know if fixed this already, but I had the same problem as you have. Your plugin is linking against the wrong mysqlclient library. You fix this by running the install_name_tool command:


install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient_r.18.dylib libqsqlmysql.dylib