Results 1 to 7 of 7

Thread: Build MySql driver in Windows Vista

  1. #1
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Question Build MySql driver in Windows Vista

    Hello everyone,

    straight to te point: how to build MySql driver under Windows Vista?

    I've just made a MySql application that works in Xp, but fails to load driver in Vista, so I thought maybe this is dued to in-Xp-built driver. Anyway the problem could be common.
    Trying to build it following documentation's instructions leads me to a serie of linker errors (follows a snip).
    If you can point me to a verbose and working tutorial would be good too!
    Suggestions are welcome here

    ...
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x4cc2):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:986: undefined reference to `
    mysql_stmt_bind_result@8'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x4ea3):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:993: undefined reference to `
    mysql_stmt_attr_set@12'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x4ec1):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:995: undefined reference to `
    mysql_stmt_store_result@4'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x50ac):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1007: undefined reference to
    `mysql_stmt_bind_result@8'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x6442): In function `ZN12QMYSQLDriver4o
    penERK7QStringS2_S2_S2_iS2_':
    C:/Qt/4.4.3/src/plugins/sqldrivers/mysql/../../../sql/drivers/mysql/qsql_mysql.c
    pp:1200: undefined reference to `mysql_init@4'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x66d3):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1200: undefined reference to
    `mysql_real_connect@32'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x691f):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1215: undefined reference to
    `mysql_select_db@8'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x6bf9):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1218: undefined reference to
    `mysql_close@4'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x6ec1):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1225: undefined reference to
    `mysql_close@4'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x6f39):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1232: undefined reference to
    `mysql_set_character_set@8'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x6f79):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1239: undefined reference to
    `mysql_get_client_version@0'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x6f90):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1239: undefined reference to
    `mysql_get_server_version@4'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x70e0): In function `ZN12QMYSQLDriver5c
    loseEv':
    C:/Qt/4.4.3/src/plugins/sqldrivers/mysql/../../../sql/drivers/mysql/qsql_mysql.c
    pp:1253: undefined reference to `mysql_close@4'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x7267): In function `ZNK12QMYSQLDriver6
    tablesEN4QSql9TableTypeE':
    C:/Qt/4.4.3/src/plugins/sqldrivers/mysql/../../../sql/drivers/mysql/qsql_mysql.c
    pp:1272: undefined reference to `mysql_list_tables@8'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x729c):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1276: undefined reference to
    `mysql_data_seek@12'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x72aa):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1277: undefined reference to
    `mysql_fetch_row@4'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x7360):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1283: undefined reference to
    `mysql_free_result@4'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x7f42): In function `ZNK12QMYSQLDriver6
    recordERK7QString':
    C:/Qt/4.4.3/src/plugins/sqldrivers/mysql/../../../sql/drivers/mysql/qsql_mysql.c
    pp:1318: undefined reference to `mysql_list_fields@12'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x7f9c):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1323: undefined reference to
    `mysql_fetch_field@4'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x8060):C:/Qt/4.4.3/src/plugins/sqldrive
    rs/mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1325: undefined reference to
    `mysql_free_result@4'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x8166): In function `ZN12QMYSQLDriver16
    beginTransactionEv':
    C:/Qt/4.4.3/src/plugins/sqldrivers/mysql/../../../sql/drivers/mysql/qsql_mysql.c
    pp:1343: undefined reference to `mysql_query@8'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x8324): In function `ZN12QMYSQLDriver17
    commitTransactionEv':
    C:/Qt/4.4.3/src/plugins/sqldrivers/mysql/../../../sql/drivers/mysql/qsql_mysql.c
    pp:1360: undefined reference to `mysql_query@8'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x84e2): In function `ZN12QMYSQLDriver19
    rollbackTransactionEv':
    C:/Qt/4.4.3/src/plugins/sqldrivers/mysql/../../../sql/drivers/mysql/qsql_mysql.c
    pp:1377: undefined reference to `mysql_query@8'
    tmp/obj/debug_shared/qsql_mysql.o(.text+0x89d0): In function `ZNK12QMYSQLDriver1
    1formatValueERK9QSqlFieldb':
    C:/Qt/4.4.3/src/plugins/sqldrivers/mysql/../../../sql/drivers/mysql/qsql_mysql.c
    pp:1402: undefined reference to `mysql_real_escape_string@16'
    collect2: ld returned 1 exit status
    mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlmysqld4.dll] Error 1
    mingw32-make[1]: Leaving directory `C:/Qt/4.4.3/src/plugins/sqldrivers/mysql'
    mingw32-make: *** [debug-all] Error 2
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

  2. #2
    Join Date
    Jan 2010
    Location
    Ankara, Turkey
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Build MySql driver in Windows Vista

    I know, it will be unrelated but you can use QODBC with MySQL ODBC connector under Windows. It is easier than compiling MySQL driver in my opinion.
    A fan of Qt since November 2009.

  3. #3
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Build MySql driver in Windows Vista

    Take a look here: http://osum.sun.com/group/escomipnos...do-driver-para
    He wrote a pdf about it (in Spanish ).
    Look easy to follow ... i would try it myself but ... divorced from Wiandow$

  4. The following user says thank you to graciano for this useful post:

    Raccoon29 (11th January 2010)

  5. #4
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Build MySql driver in Windows Vista

    Quote Originally Posted by graciano View Post
    It simply worked perfectly!
    He wrote a pdf about it (in Spanish ).
    Look easy to follow ... i would try it myself but ... divorced from Wiandow$
    LOL
    Yes it was easy to follow and it works!
    My luck is that I am Italian, so I can understand Spanish somehow, they are similar.
    Anyway I'm going to ask for authorization to the author to translate it in English and Italian, it would be very helpfull!

    Thank you very much graciano!
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

  6. #5
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Build MySql driver in Windows Vista

    ...BUT!...

    Everything has compiled well and I got my wonderfull dll, anyway it works at home, but in my office Vista deploy pc it doesn't: it keeps saying "driver not loaded"...

    ENVIRONMENT:
    application dir (C:\Application):
    application.exe
    QtCore4.dll
    QtSql4.dll
    QtGui4.dll
    libmySQL.dll
    mingwm10.dll
    sqldrivers<dir> -> qsqlmysql4.dll
    it can't connect because (it says) it can't load the driver, QApplication::libraryPath() says:
    C:\Application
    well... my ideas are over, here is required a genius flash!
    Debug hints over there?
    Last edited by Raccoon29; 11th January 2010 at 11:07.
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

  7. #6
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Build MySql driver in Windows Vista

    copy qsqlmysql4.dll, run Dependency Walker on it and check what is missing, copy or add to system Path rewuired dlls.
    copying qsqlmysql4.dll one dir up is only for running Dependency Walker to make him see Qt dlls and libmySQL.dll so after that you can delete it cause your app will load it from sqldrivers dir
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  8. #7
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Build MySql driver in Windows Vista

    Thank you for the hint! But I have no Dependencies Walker.
    Instead I found solutio after re-making the driver in the Vista pc in subject.
    Solution seems to be libmysql.dll, I copied the one in MySQL\bin folder when instead I had to copy the one generated just before in MySQL\lib\opt.
    Now it works and as always you men rock!

    T h a n k y o u !
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

Similar Threads

  1. I need MySQL driver for Qt 4.6, WindowsXP(32), MySQL 5.1
    By User_3 in forum Installation and Deployment
    Replies: 7
    Last Post: 15th October 2010, 15:19
  2. Qy 4.4.3 MySQL driver failed
    By pamalite in forum Installation and Deployment
    Replies: 2
    Last Post: 23rd January 2010, 01:09
  3. cant compile mysql driver
    By IsoArska in forum Newbie
    Replies: 18
    Last Post: 30th November 2009, 22:51
  4. Qt4 and mysql(driver problem)
    By knut in forum Installation and Deployment
    Replies: 20
    Last Post: 27th December 2007, 14:47
  5. Failure to build Debug libs - Vista Mingw Qt 4.3.2
    By pmabie in forum Installation and Deployment
    Replies: 8
    Last Post: 15th October 2007, 18:04

Tags for this Thread

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.