MYSQL Installation on Mac OS X



  • Dear reader,

    When I try to make my MYSQL files I am getting the following error:

    [QUOTE]imac-van-angelo:mysql Devbizz$ make
    make -f Makefile.Debug
    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/Devbizz/QtSDK/Desktop/Qt/473/gcc/lib -L/Users/Devbizz/QtSDK/Desktop/Qt/473/gcc/lib -L/usr/local/mysql/lib -lmysqlclient -framework QtSql -framework QtCore
    ld: warning: ignoring file /usr/local/mysql/lib/libmysqlclient.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
    Undefined symbols for architecture x86_64:
    "_mysql_real_escape_string", referenced from:
    QMYSQLDriver::formatValue(QSqlField const&, bool) constin qsql_mysql.o
    "_mysql_error", referenced from:
    qMakeError(QString const&, QSqlError::ErrorType, QMYSQLDriverPrivate const*)in qsql_mysql.o
    "_mysql_errno", referenced from:
    qMakeError(QString const&, QSqlError::ErrorType, QMYSQLDriverPrivate const*)in qsql_mysql.o
    QMYSQLResult::record() const in qsql_mysql.o
    "_mysql_stmt_close", referenced from:
    QMYSQLResult::cleanup() in qsql_mysql.o
    "_mysql_real_query", referenced from:
    QMYSQLResult::reset(QString const&) in qsql_mysql.o
    "_mysql_stmt_init", referenced from:
    QMYSQLResult::prepare(QString const&) in qsql_mysql.o
    "_mysql_stmt_prepare", referenced from:
    QMYSQLResult::prepare(QString const&) in qsql_mysql.o
    "_mysql_stmt_result_metadata", referenced from:
    QMYSQLResultPrivate::bindInValues() in qsql_mysql.o
    "_mysql_num_fields", referenced from:
    QMYSQLResultPrivate::bindInValues() in qsql_mysql.o
    ld: symbol(s) not found for architecture x86_64
    collect2: ld returned 1 exit status
    make[1]: *** [libqsqlmysql_debug.dylib] Error 1
    make: *** [debug] Error 2
    imac-van-angelo:mysql Devbizz$ [/QUOTE]

    What I did was:
    [CODE]qmake -o Makefile "INCLUDEPATH+=/usr/local/mysql/include" "LIBS+=-L/usr/local/mysql/lib -lmysqlclient" mysql.pro[/CODE]

    No errors there, so I think everything is alright.

    After that I give the command:

    [CODE]make[/code]

    which results in the error above.

    Can someone tell me what I did wrong?

    P.S. its not the full error code, cause it would overwrite the maximum number of allowed characters in this post :)



  • Your Qt version is built as 64 bit version (x86_64), but the mysql libs you have installed are not, most probably, they're 32bit Intel binaries (i386). You can check on the command line using this:

    @
    lipo -info /usr/local/mysql/lib/libmysqlclient.dylib
    @


Log in to reply
 

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