Results 1 to 3 of 3

Thread: Qy 4.4.3 MySQL driver failed

  1. #1
    Join Date
    Nov 2007
    Posts
    6
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Qy 4.4.3 MySQL driver failed

    Hi,

    I have tried installing the Qt 4.4.3 framework on Mac OS X 10.5.6 Leopard with no success. I tried both normal driver and plugin. It just will not compile.

    The configure:

    > ./configure -qt-sql-mysql -I/usr/local/mysql/include -L/usr/local/mysql/lib -universal
    > sudo make

    And I get this after some compilations later:

    Qt Code:
    1. ld: warning in /usr/local/mysql/lib/libmysqlclient_r.dylib, file is not of required architecture
    2. ld: warning in /usr/local/mysql/lib/libmygcc.a, file is not of required architecture
    3. Undefined symbols:
    4. "_mysql_query", referenced from:
    5. QMYSQLDriver::beginTransaction() in qsql_mysql.o
    6. QMYSQLDriver::commitTransaction() in qsql_mysql.o
    7. QMYSQLDriver::rollbackTransaction() in qsql_mysql.o
    8. "_mysql_num_rows", referenced from:
    9. QMYSQLResult::fetchLast() in qsql_mysql.o
    10. QMYSQLResult::size() in qsql_mysql.o
    11. "_mysql_stmt_param_count", referenced from:
    12. QMYSQLResult::prepare(QString const&) in qsql_mysql.o
    13. QMYSQLResult::prepare(QString const&) in qsql_mysql.o
    14. QMYSQLResult::exec() in qsql_mysql.o
    15. QMYSQLResult::exec() in qsql_mysql.o
    16. "_mysql_fetch_lengths", referenced from:
    17. QMYSQLResult::data(int) in qsql_mysql.o
    18. "_mysql_stmt_bind_param", referenced from:
    19. QMYSQLResult::exec() in qsql_mysql.o
    20. "_mysql_stmt_data_seek", referenced from:
    21. QMYSQLResult::fetch(int) in qsql_mysql.o
    22. "_mysql_select_db", referenced from:
    23. QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&)in qsql_mysql.o
    24. "_mysql_stmt_insert_id", referenced from:
    25. QMYSQLResult::lastInsertId() const in qsql_mysql.o
    26. "_mysql_stmt_close", referenced from:
    27. QMYSQLResult::cleanup() in qsql_mysql.o
    28. "_mysql_set_character_set", referenced from:
    29. QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&)in qsql_mysql.o
    30. "_mysql_stmt_init", referenced from:
    31. QMYSQLResult::prepare(QString const&) in qsql_mysql.o
    32. "_mysql_get_client_version", referenced from:
    33. QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&)in qsql_mysql.o
    34. "_mysql_get_server_version", referenced from:
    35. QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&)in qsql_mysql.o
    36. "_mysql_list_fields", referenced from:
    37. QMYSQLDriver::record(QString const&) constin qsql_mysql.o
    38. "_mysql_stmt_num_rows", referenced from:
    39. QMYSQLResult::fetchLast() in qsql_mysql.o
    40. QMYSQLResult::size() in qsql_mysql.o
    41. "_mysql_stmt_fetch", referenced from:
    42. QMYSQLResult::fetch(int) in qsql_mysql.o
    43. QMYSQLResult::fetchNext() in qsql_mysql.o
    44. "_mysql_stmt_result_metadata", referenced from:
    45. QMYSQLResultPrivate::bindInValues() in qsql_mysql.o
    46. "_mysql_server_end", referenced from:
    47. qLibraryEnd() in qsql_mysql.o
    48. "_mysql_init", referenced from:
    49. QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&)in qsql_mysql.o
    50. "_mysql_close", referenced from:
    51. QMYSQLDriver::close() in qsql_mysql.o
    52. QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&)in qsql_mysql.o
    53. QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&)in qsql_mysql.o
    54. "_mysql_field_count", referenced from:
    55. QMYSQLResult::nextResult() in qsql_mysql.o
    56. QMYSQLResult::reset(QString const&) in qsql_mysql.o
    57. QMYSQLResult::reset(QString const&) in qsql_mysql.o
    58. "_mysql_stmt_execute", referenced from:
    59. QMYSQLResult::exec() in qsql_mysql.o
    60. "_mysql_stmt_errno", referenced from:
    61. qMakeStmtError(QString const&, QSqlError::ErrorType, st_mysql_stmt*)in qsql_mysql.o
    62. "_mysql_stmt_error", referenced from:
    63. qMakeStmtError(QString const&, QSqlError::ErrorType, st_mysql_stmt*)in qsql_mysql.o
    64. "_mysql_stmt_affected_rows", referenced from:
    65. QMYSQLResult::exec() in qsql_mysql.o
    66. "_mysql_list_tables", referenced from:
    67. QMYSQLDriver::tables(QSql::TableType) const in qsql_mysql.o
    68. "_mysql_real_connect", referenced from:
    69. QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&)in qsql_mysql.o
    70. "_mysql_real_escape_string", referenced from:
    71. QMYSQLDriver::formatValue(QSqlField const&, bool) constin qsql_mysql.o
    72. "_mysql_stmt_reset", referenced from:
    73. QMYSQLResult::exec() in qsql_mysql.o
    74. "_mysql_stmt_prepare", referenced from:
    75. QMYSQLResult::prepare(QString const&) in qsql_mysql.o
    76. "_mysql_free_result", referenced from:
    77. QMYSQLDriver::record(QString const&) constin qsql_mysql.o
    78. QMYSQLDriver::tables(QSql::TableType) const in qsql_mysql.o
    79. QMYSQLResult::cleanup() in qsql_mysql.o
    80. QMYSQLResult::cleanup() in qsql_mysql.o
    81. QMYSQLResult::cleanup() in qsql_mysql.o
    82. QMYSQLResult::nextResult() in qsql_mysql.o
    83. "_mysql_data_seek", referenced from:
    84. QMYSQLResult::fetch(int) in qsql_mysql.o
    85. QMYSQLDriver::tables(QSql::TableType) const in qsql_mysql.o
    86. "_mysql_stmt_bind_result", referenced from:
    87. QMYSQLResult::exec() in qsql_mysql.o
    88. QMYSQLResult::exec() in qsql_mysql.o
    89. "_mysql_num_fields", referenced from:
    90. QMYSQLResultPrivate::bindInValues() in qsql_mysql.o
    91. "_mysql_insert_id", referenced from:
    92. QMYSQLResult::lastInsertId() const in qsql_mysql.o
    93. "_mysql_stmt_store_result", referenced from:
    94. QMYSQLResult::exec() in qsql_mysql.o
    95. "_mysql_stmt_attr_set", referenced from:
    96. QMYSQLResult::exec() in qsql_mysql.o
    97. "_mysql_store_result", referenced from:
    98. QMYSQLResult::cleanup() in qsql_mysql.o
    99. QMYSQLResult::nextResult() in qsql_mysql.o
    100. QMYSQLResult::reset(QString const&) in qsql_mysql.o
    101. "_mysql_errno", referenced from:
    102. qMakeError(QString const&, QSqlError::ErrorType, QMYSQLDriverPrivate const*)in qsql_mysql.o
    103. QMYSQLResult::record() const in qsql_mysql.o
    104. "_mysql_error", referenced from:
    105. qMakeError(QString const&, QSqlError::ErrorType, QMYSQLDriverPrivate const*)in qsql_mysql.o
    106. "_mysql_affected_rows", referenced from:
    107. QMYSQLResult::nextResult() in qsql_mysql.o
    108. QMYSQLResult::reset(QString const&) in qsql_mysql.o
    109. "_mysql_real_query", referenced from:
    110. QMYSQLResult::reset(QString const&) in qsql_mysql.o
    111. "_mysql_fetch_field", referenced from:
    112. QMYSQLResult::record() const in qsql_mysql.o
    113. QMYSQLResult::record() const in qsql_mysql.o
    114. QMYSQLDriver::record(QString const&) constin qsql_mysql.o
    115. QMYSQLResultPrivate::bindInValues() in qsql_mysql.o
    116. "_mysql_fetch_field_direct", referenced from:
    117. QMYSQLResult::nextResult() in qsql_mysql.o
    118. QMYSQLResult::reset(QString const&) in qsql_mysql.o
    119. "_mysql_character_set_name", referenced from:
    120. codec(st_mysql*) in qsql_mysql.o
    121. "_mysql_field_seek", referenced from:
    122. QMYSQLResult::record() const in qsql_mysql.o
    123. QMYSQLResult::record() const in qsql_mysql.o
    124. "_mysql_next_result", referenced from:
    125. QMYSQLResult::cleanup() in qsql_mysql.o
    126. QMYSQLResult::nextResult() in qsql_mysql.o
    127. "_mysql_server_init", referenced from:
    128. qLibraryInit() in qsql_mysql.o
    129. "_mysql_fetch_row", referenced from:
    130. QMYSQLResult::fetch(int) in qsql_mysql.o
    131. QMYSQLResult::fetchNext() in qsql_mysql.o
    132. QMYSQLDriver::tables(QSql::TableType) const in qsql_mysql.o
    133. ld: symbol(s) not found
    134. collect2: ld returned 1 exit status
    135. lipo: can't open input file: /var/tmp//cckcrMCB.out (No such file or directory)
    136. make[2]: *** [../../lib/QtSql.framework/QtSql_debug] Error 1
    137. make[1]: *** [debug-all] Error 2
    138. make: *** [sub-sql-make_default-ordered] Error 2
    To copy to clipboard, switch view to plain text mode 

    I also tried installing using -plugin-sql-mysql, it does not work. I also tried just use the normal "./configure" without any flags, also fails at the same spot.

    I have MySQL installed using the pre-compiled package, which it stores all the headers and libraries in /usr/local/mysql which is a symbolic link to /usr/local/mysql-5.1.30-osx10.5-x86_64.

    Perhaps can anyone point out what am I doing wrong? I need help.

  2. #2
    Join Date
    Nov 2007
    Posts
    6
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Qy 4.4.3 MySQL driver failed [solved]

    I found the problem and solved it.

    It turns out that Qt 4.4.3 uses only 32-bit while the MySQL I am using is using 64-bit.

    The problem became obvious when I tried to compile Qt as a framework with the flag -arch x86_64 turned on. The compile just stops at qcursor. I turned on the flag because I was double-checking my MySQL version and found I am using the x86_64:

    /usr/local/mysql -> mysql-5.1.30-osx10.5-x86_64

    So, I downloaded the normal x86 version from MySQL.com, compile Qt using

    -I/usr/local/mysql/include and -L/usr/local/mysql/lib flags

    with MySQL driver as a plugin (default), everything went smoothly.

    Right now, the link points to

    /usr/local/mysql -> mysql-5.1.31-osx10.5-x86

    Off-topic:

    I hope all these 32 and 64 bit binaries to be solved in Snow Leopard, as I have read an article saying Leopard still has binaries mixed with 32 and 64 bits. One of the problems I am having is the default PHP not working with its image libraries, because of the same issue.

  3. The following user says thank you to pamalite for this useful post:

    hamid ghous (23rd January 2010)

  4. #3
    Join Date
    Jun 2009
    Posts
    27
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Qy 4.4.3 MySQL driver failed [solved]

    Thanks pamalite, I was doing the same mistake....its working now


    Quote Originally Posted by pamalite View Post
    I found the problem and solved it.

    It turns out that Qt 4.4.3 uses only 32-bit while the MySQL I am using is using 64-bit.

    The problem became obvious when I tried to compile Qt as a framework with the flag -arch x86_64 turned on. The compile just stops at qcursor. I turned on the flag because I was double-checking my MySQL version and found I am using the x86_64:

    /usr/local/mysql -> mysql-5.1.30-osx10.5-x86_64

    So, I downloaded the normal x86 version from MySQL.com, compile Qt using

    -I/usr/local/mysql/include and -L/usr/local/mysql/lib flags

    with MySQL driver as a plugin (default), everything went smoothly.

    Right now, the link points to

    /usr/local/mysql -> mysql-5.1.31-osx10.5-x86

    Off-topic:

    I hope all these 32 and 64 bit binaries to be solved in Snow Leopard, as I have read an article saying Leopard still has binaries mixed with 32 and 64 bits. One of the problems I am having is the default PHP not working with its image libraries, because of the same issue.

Similar Threads

  1. mysql driver not loaded after deployment
    By tpf80 in forum Newbie
    Replies: 4
    Last Post: 4th September 2011, 11:12
  2. Qt mysql driver installation problem
    By alphajoseph in forum Installation and Deployment
    Replies: 1
    Last Post: 8th February 2009, 12:56
  3. My Mysql 5 and Qt 4.2.2 Problem (Driver not loaded)
    By fengtian.we in forum Qt Programming
    Replies: 4
    Last Post: 9th February 2007, 09:11
  4. MySql plugin driver issues
    By stevey in forum Installation and Deployment
    Replies: 11
    Last Post: 20th September 2006, 14:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.