[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

    @
    cd / Users/<myusername>/QtSDK/QtSources/4.8.0/src/plugins/sqldrivers/mysql
    /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
    make
    make install
    @

    My Result For make install
    @
    make -f Makefile.Debug install
    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
    @
    cd <to app release dir>
    macdeployqt appname.app
    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.

    1. 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



  • My result For Make Command
    @
    make -f Makefile.Debug
    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
    /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
    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
    /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
    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
    rm -f libqsqlmysql_debug.dylib
    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
    @



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

    On the make file i ran

    @/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
    make
    make install
    @
    Change to
    @
    /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
    make
    make install
    @

    That still only built the debug for me but then i ran
    @make -f Makefile.Release install
    @

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



  • i already follow steps above but still mysql driver not loaded

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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.