March 16, 2012

ShapeShifter ShapeShifter
Lab Rat
10 posts

[Solved] Qt Mysql On Mac Only Creating Debug Version

 

Good Day All.
Ive been creating applications some time on linux And then deploying them onto windows machine.
But no i need to deploy an application on Mac osx Lion.

I also Have a Mac OSX Lion on my macbook to compile for clients.

I did the following steps to install qt and mysql and build the plugin.

1) Download and install QTSDK
2) Using SDK maintenence Tool I Downloaded Sources for 4.8.0
3) Download And Install Mysql (I downloaded mysql-5.1.53-osx10.6-x86_64.dmg)
4) Then I opened Terminal And Did the following

  1. cd / Users/<myusername>/QtSDK/QtSources/4.8.0/src/plugins/sqldrivers/mysql
  2. /Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/bin/qmake -o Makefile "INCLUDEPATH+=/usr/local/mysql-5.1.61-osx10.6-x86_64/include" "LIBS+=-L/usr/local/mysql-5.1.61-osx10.6-x86_64/lib -lmysqlclient_r" mysql.pro
  3. make
  4. make install

My Result For make install

  1. make -f Makefile.Debug install
  2. cp -f "libqsqlmysql_debug.dylib" "/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/plugins/sqldrivers/libqsqlmysql_debug.dylib"

As you can see it only seems to make the debug version.
But if i build the release version on my mac mysql works great.

To move the app to my clients app i do the following

  1. cd <to app release dir>
  2. macdeployqt appname.app
  3. The resulting .app I copy to the clients mac and run the app.

I then get driver not loaded errors.

As far as i can see i have one of 2 problems.
1)Either im deploying the application incorectly using macdeploy. If i am can someone put me in the right direction.
2) I have a problewm that it is only building the debug verion of mysqllib. if so can someone please explain to me how to build the release version.

Regards
Donovan Hoare

 Signature 

Unique Requirements, Require Unique Solutions
www.atstech.co.za

3 replies

March 16, 2012

ShapeShifter ShapeShifter
Lab Rat
10 posts

My result For Make Command

  1. make -f Makefile.Debug
  2. g++ -c -pipe -g -gdwarf-2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/default -I. -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtCore.framework/Versions/4/Headers -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtSql.framework/Versions/4/Headers -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include/QtSql -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include -I/usr/local/mysql-5.1.61-osx10.6-x86_64/include -Idebug -F/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib -o debug/main.o main.cpp
  3. /Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/bin/moc -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/default -I. -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtCore.framework/Versions/4/Headers -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtSql.framework/Versions/4/Headers -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include/QtSql -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include -I/usr/local/mysql-5.1.61-osx10.6-x86_64/include -Idebug -F/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib -D__APPLE__ -D__GNUC__ ../../../sql/drivers/mysql/qsql_mysql.cpp -o debug/qsql_mysql.moc
  4. g++ -c -pipe -g -gdwarf-2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/default -I. -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtCore.framework/Versions/4/Headers -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtSql.framework/Versions/4/Headers -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include/QtSql -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include -I/usr/local/mysql-5.1.61-osx10.6-x86_64/include -Idebug -F/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib -o debug/qsql_mysql.o ../../../sql/drivers/mysql/qsql_mysql.cpp
  5. /Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/bin/moc -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/default -I. -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtCore.framework/Versions/4/Headers -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtSql.framework/Versions/4/Headers -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include/QtSql -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include -I/usr/local/mysql-5.1.61-osx10.6-x86_64/include -Idebug -F/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib -D__APPLE__ -D__GNUC__ ../../../sql/drivers/mysql/qsql_mysql.h -o debug/moc_qsql_mysql.cpp
  6. g++ -c -pipe -g -gdwarf-2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/default -I. -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtCore.framework/Versions/4/Headers -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtSql.framework/Versions/4/Headers -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include/QtSql -I/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/include -I/usr/local/mysql-5.1.61-osx10.6-x86_64/include -Idebug -F/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib -o debug/moc_qsql_mysql.o debug/moc_qsql_mysql.cpp
  7. rm -f libqsqlmysql_debug.dylib
  8. g++ -headerpad_max_install_names -arch x86_64 -single_module -dynamiclib -Xarch_x86_64 -mmacosx-version-min=10.5 -o libqsqlmysql_debug.dylib debug/main.o debug/qsql_mysql.o debug/moc_qsql_mysql.o  -F/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib -L/Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/lib -L/usr/local/mysql-5.1.61-osx10.6-x86_64/lib -lmysqlclient_r -framework QtSql -framework QtCore

 Signature 

Unique Requirements, Require Unique Solutions
www.atstech.co.za

March 16, 2012

ShapeShifter ShapeShifter
Lab Rat
10 posts

OK perhaps this post helped as i read something i didnt before

On the make file i ran

  1. /Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/bin/qmake -o Makefile "INCLUDEPATH+=/usr/local/mysql-5.1.61-osx10.6-x86_64/include" "LIBS+=-L/usr/local/mysql-5.1.61-osx10.6-x86_64/lib -lmysqlclient_r" mysql.pro
  2. make
  3. make install

Change to
  1. /Users/donovanhoare/QtSDK/Desktop/Qt/4.8.0/gcc/bin/qmake  "INCLUDEPATH+=/usr/local/mysql-5.1.61-osx10.6-x86_64/include" "LIBS+=-L/usr/local/mysql-5.1.61-osx10.6-x86_64/lib -lmysqlclient_r" mysql.pro
  2. make
  3. make install

That still only built the debug for me but then i ran

  1. make -f Makefile.Release install

That built the release version and now macdeploy works great. I hope this post helps someone Out there

 Signature 

Unique Requirements, Require Unique Solutions
www.atstech.co.za

August 5, 2012

adi nata adi nata
Lab Rat
1 posts

i already follow steps above but still mysql driver not loaded

after copy libmysqlclient.18.dylib to /usr/lib mysql driver works

 
  ‹‹ starting with qt      build Qt on on one platform, target QNX and use the stage/ folder in another Qt creator ››

You must log in to post a reply. Not a member yet? Register here!