Results 1 to 5 of 5

Thread: Can't build mysql plugin on w7 -64

  1. #1
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Can't build mysql plugin on w7 -64

    Hi!
    So, here we go again. I've decided to develop applications on my laptop so I'm back to scratch on compiling the driver for mySQL.
    I've already done it on my desktop computer (and it drove me to the edge of sanity) with the same operating system so I was hoping that the same .a and .dll's would work, but no. Unfortunately I don't remember exactly how I got it to work but I do remember it was by compiling it with nmake and it has worked fine for a good while even though I usually use minGW for compiling my applications.

    Any way, Ive tied the standard way (using nmake) from the docs and I get this error a short while after running nmake:


    Qt Code:
    1. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-ps
    2. eudo-reloc -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\2010.05\qt\plugins\sqldr
    3. ivers\libqsqlmysqld4.a -o ..\..\..\..\plugins\sqldrivers\qsqlmysqld4.dll tmp/obj
    4. /debug_shared/main.o tmp/obj/debug_shared/qsql_mysql.o tmp/obj/debug_shared/mo
    5. c_qsql_mysql.o -L"c:\Qt\2010.05\qt\lib" -L"c:\Qt\2010.05\qt\lib" tmp\obj\debug_
    6. shared\qsqlmysqld_resource_res.o C:\mysql51\lib\opt\libmysql.lib -lQtSqld4 -lQtC
    7. ored4
    8. Creating library file: c:\Qt\2010.05\qt\plugins\sqldrivers\libqsqlmysqld4.a
    9. tmp/obj/debug_shared/qsql_mysql.o: In function `codec':
    10. C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_my
    11. sql.cpp:223: undefined reference to `mysql_character_set_name@4'
    12. tmp/obj/debug_shared/qsql_mysql.o: In function `qMakeError':
    13. C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_my
    14. sql.cpp:234: undefined reference to `mysql_error@4'
    15. C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_my
    16. sql.cpp:237: undefined reference to `mysql_errno@4'
    17. tmp/obj/debug_shared/qsql_mysql.o: In function `qMakeStmtError':
    18. C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_my
    19. sql.cpp:309: undefined reference to `mysql_stmt_error@4'
    20. C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_my
    21. sql.cpp:312: undefined reference to `mysql_stmt_errno@4'
    22. tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/
    23. ../../../sql/drivers/mysql/qsql_mysql.cpp:358: undefined reference to `mysql_stm
    24. t_result_metadata@4'
    25. tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/
    26. ../../../sql/drivers/mysql/qsql_mysql.cpp:362: undefined reference to `mysql_num
    27. _fields@4'
    28. tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/
    29. ../../../sql/drivers/mysql/qsql_mysql.cpp:369: undefined reference to `mysql_fet
    30. ch_field@4'
    31. tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/
    32. ../../../sql/drivers/mysql/qsql_mysql.cpp:432: undefined reference to `mysql_fre
    33. e_result@4'
    34. tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/
    35. ../../../sql/drivers/mysql/qsql_mysql.cpp:438: undefined reference to `mysql_sto
    36. re_result@4'
    37.  
    38. ......
    39.  
    40. ......
    41.  
    42. tmp/obj/debug_shared/qsql_mysql.o:C:\Qt\2010.05\qt\src\plugins\sqldrivers\mysql/
    43. ../../../sql/drivers/mysql/qsql_mysql.cpp:1507: undefined reference to `mysql_re
    44. al_escape_string@16'
    45. collect2: ld returned 1 exit status
    46. NMAKE : fatal error U1077: 'C:\Qt\2010.05\mingw\bin\g++.EXE' : return code '0x1'
    47.  
    48. Stop.
    49. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
    50. \VC\bin\nmake.exe"' : return code '0x2'
    51. Stop.
    To copy to clipboard, switch view to plain text mode 

    Could anyone help me with this?
    Thanks a lot!
    /Tottish

  2. #2
    Join Date
    Sep 2010
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't build mysql plugin on w7 -64

    did you manage to fix this? im having the same problem

  3. #3
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't build mysql plugin on w7 -64

    Sorry but I didn't... at least not in any conventional sense.
    When I wrote the above posts I basically sat two days straight with this problem without anything to show for it. About a week ago I spent another whole day trying to get it to work, but no dice.
    This made me so frustrated since I had it all up and running on my other computer with the very same OS but can not for the life of me remember how I compiled it since I had been trying a million and a half ways.

    So what did I do? (Not recommended to anyone, I know this is extremely ugly but it actually runs excellent):
    So I had the SDK+compiled MySQL-plugin up'n'running on my desktop computer but not on my laptop (with the same OS), right?
    1. I located the SDK install-file (think it was 2010.05), removed anything related to Qt from the laptop harddrive and then made a full install on my laptop directly in 'C:\' (where a folder named 'Qt' was generated by the install).
    2. Deleted the complete content in the 'Qt'-root folder.
    3. Copied the entire content of the Qt-folder from my desktop PC and pasted in the Qt-folder on my Laptop. (The install folder was the same on my Desktop PC (C:\Qt) which I'm guessing could be crucial)
    4. Presto, everything seems to be working perfect(!!!).
    Can't say that I expected this to work, but it did.

    This has made me wonder (since I'm under the impression that compiling this driver under Win is a huge pain in the butt and that me and crazymonkey aren't the only ones that think so) why not just have a bunch of pre-compiled drivers with the necessary files to go with them for us not too experienced developers to download and use?
    Or even better, provide a guide that actually works? I dare say, after all those hours I spent that I have tried most of them out there and each and every have a different approach making different statements about what one must do in order to make it work (including having to recompile Qt from source) and more importantly, none of them seem to actually do the trick out of the box. =)

    I'll send the the guys at Nokia/Qt-department a note on this, shouldn't be much of a newsflash but the least I can do if I want to complain is to direct it to someone who might find it in their heart to help out. =)

    Have an awesome day!
    /Tottish

  4. #4
    Join Date
    Sep 2010
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't build mysql plugin on w7 -64

    this is such a problem, i need to interface with mysql and it has no support for ODBC (only jdbc)

    so my only way to do this is to compile the mysql drivers for Qt, ive been at this for 3 days, and its so frustrating, people keep telling me to look at the support documents but they dont help i get the same errors. ive tried every guide on the internet, even the outdated ones. im so frustrated

  5. #5
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't build mysql plugin on w7 -64

    Hang in there bro. Sorry I can't be of any help. Try asking in the qt-channel on freenode IRC, those guys might be able to help.

    I know you'll get it right sooner or later and when you do, be sure to write down every step of the way and post it back in this thread.
    Best of luck to you!
    /Tottish

Similar Threads

  1. Can't build Qt with MySQL
    By Tottish in forum Newbie
    Replies: 4
    Last Post: 29th September 2010, 14:42
  2. MySql plugin
    By hubipet in forum Installation and Deployment
    Replies: 0
    Last Post: 7th August 2010, 11:23
  3. Build Mysql plugin for Qt
    By Qt Coder in forum Qt Programming
    Replies: 9
    Last Post: 19th September 2009, 09:07
  4. Replies: 1
    Last Post: 14th July 2009, 09:28
  5. How build mysql plugin
    By MrShahi in forum Installation and Deployment
    Replies: 5
    Last Post: 8th June 2008, 00:11

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.