Results 1 to 5 of 5

Thread: Huge problems while installing QMYSQL driver

  1. #1
    Join Date
    Nov 2009
    Posts
    61
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Huge problems while installing QMYSQL driver

    Hi All,

    This is finally out of my hands. I give up. I find it too difficult to do it.

    On WIndows 7 64bit with installed QtSDK 1.2.1, I tried to build the module QMYSQL. I though I could find it while running QtSDK package installer / updater but none of this is available from there. After digging in google, I found this article. The instructions does not match what can be found after installing MySql Server 5.5.27. There is no directory like "opt" in <path to Mysql>\lib\" folder. It was however the least problem along with I found also following issues:
    * backslashes need to be escaped -- not mentioned on websit, e.g. C:\\Program Files\\Mysql\\Mysql Server 5.5.27\\..." etc. Otherwise qmake warns about it
    * include and lib folders have to be copied into any folder outside C:\Program Files or C:\Program Files(86)\ or any system-like folders; they seem to be protected from accessing--I am guessing it but I ended up with this conclusion when I couldn't even start compilation because mysql.h couldn't be found even though I have specified the exact path.

    After figuring out these issues, I finally kicked off and made "make" started working but it cannot finish it. I wanted to have the released version so I run command:
    Qt Code:
    1. make release
    To copy to clipboard, switch view to plain text mode 

    and got this log:
    Qt Code:
    1. make -f Makefile.Release
    2. make[1]: Entering directory `C:/QtSDK/QtSources/4.8.1/src/plugins/sqldrivers/mysql'
    3. g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"release" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o release\main.o main.cpp
    4. C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"release" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.cpp -o release\qsql_mysql.moc
    5. g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"release" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o release\qsql_mysql.o ..\..\..\sql\drivers\mysql\qsql_mysql.cpp
    6. C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"release" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.h -o release\moc_qsql_mysql.cpp
    7. g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"release" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o release\moc_qsql_mysql.o release\moc_qsql_mysql.cpp
    8. windres -i qsqlmysql_resource.rc -o release\qsqlmysql_resource_res.o --include-dir=. -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT
    9. g++ -Wl,-s -mthreads -shared -Wl,--out-implib,release\libqsqlmysql4.a -o release\qsqlmysql4.dll release/main.o release/qsql_mysql.o release/moc_qsql_mysql.o -L"c:\QtSDK\Desktop\Qt\4.8.1\mingw\lib" release\qsqlmysql_resource_res.o -lmysql.lib -lQtSql4 -lQtCore4
    10. c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lmysql.lib
    11. collect2.exe: error: ld returned 1 exit status
    12. make[1]: *** [release\qsqlmysql4.dll] Error 1
    13. make[1]: Leaving directory `C:/QtSDK/QtSources/4.8.1/src/plugins/sqldrivers/mysql'
    14. make: *** [release] Error 2
    To copy to clipboard, switch view to plain text mode 

    I though I could use nmake but got similar error:
    Qt Code:
    1. 'C:\Program' is not recognized as an internal or external command,
    2. operable program or batch file.
    3.  
    4. C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\mysql>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\nmake"
    5.  
    6. Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
    7. Copyright (C) Microsoft Corporation. All rights reserved.
    8.  
    9. "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\nmake.exe" -f Makefile.Debug
    10.  
    11. Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
    12. Copyright (C) Microsoft Corporation. All rights reserved.
    13.  
    14. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o debug\main.o main.cpp
    15. C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.cpp -o debug\qsql_mysql.moc
    16. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o debug\qsql_mysql.o ..\..\..\sql\drivers\mysql\qsql_mysql.cpp
    17. C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.h -o debug\moc_qsql_mysql.cpp
    18. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o debug\moc_qsql_mysql.o debug\moc_qsql_mysql.cpp
    19. windres -i qsqlmysqld_resource.rc -o debug\qsqlmysqld_resource_res.o --include-dir=. -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT
    20. g++ -mthreads -shared -Wl,--out-implib,debug\libqsqlmysqld4.a -o debug\qsqlmysqld4.dll debug/main.o debug/qsql_mysql.o debug/moc_qsql_mysql.o -L"c:\QtSDK\Desktop\Qt\4.8.1\mingw\lib" debug\qsqlmysqld_resource_res.o -lmysql.lib -lQtSqld4 -lQtCored4
    21. c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lmysql.lib
    22. collect2.exe: error: ld returned 1 exit status
    23. NMAKE : fatal error U1077: 'C:\MinGW\bin\g++.EXE' : return code '0x1'
    24. Stop.
    25. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\nmake.exe"' : return code '0x2'
    26. Stop.
    To copy to clipboard, switch view to plain text mode 

    As you can see, there is still missing the same file "mysql.lib". I tried "make", "make debug" etc. but it did not help.
    I don't know where to find it. In neither of these downloaded following files: ZIP archive of MySql 5.5.27 (32,64 bit), ZIP archive with connector/C, MSI installer with option "complete" of MySql 5.5.27 I could find it.

    This is really overwhelming me. I am not advanced programmer. I am not even intermediate programmer. So far, I found Qt so well documented but not this. The procedure in the website I have provided link to is for pretty much highly skilled people who are experienced in Unix-like systems. QMYSQL should be installed via the installer, especially in QtSDK that supposed to be for beginners. Also, MySql is one of the most popular engine and for free.

    I hope someone can help here.

    Regards.

  2. #2
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Huge problems while installing QMYSQL driver

    Check if you have the lmysql.lib , and try to enter the path of that library in your system PATH.

    Edit, not read the last line, seems that you have to compile mysql by your self... Or check if you have a libmysql.lib and make a copy named lmysql.lib and add this to your path...
    Last edited by RoyBellingan; 14th August 2012 at 15:45.

  3. #3
    Join Date
    Nov 2009
    Posts
    61
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Huge problems while installing QMYSQL driver

    Quote Originally Posted by RoyBellingan View Post
    Check if you have the lmysql.lib , and try to enter the path of that library in your system PATH.

    Edit, not read the last line, seems that you have to compile mysql by your self...
    Hi,
    There's no such file like mysql.lib or lmysql.lib. BTW, isn't it the option "-l" and the argument "mysql.lib"?

  4. #4
    Join Date
    Nov 2009
    Posts
    61
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Huge problems while installing QMYSQL driver

    Hi,

    Could someone please direct me how to search to solve the problem? I know it's stupid question but I googled it a lot but did not come across any solution on that particular issue. I am quite beginner regarding static and dynamic library and this is the first time I am trying to build a module. At the moment, I know what the difference between libraries is but this is still nit enough. I read about GNU Make to try to understand how the module is to build or how the application is built at all. I think I followed that. However, it is still overwhelming, although I am slowly progressing. The thing is that I am sure someone with a good experience could provide some clues about what one would do when facing things like this.

    Thanks.

  5. #5
    Join Date
    Nov 2009
    Posts
    61
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Huge problems while installing QMYSQL driver

    I managed to build qsqlmysql4.dll, qsqlmysqld4.dll. I copied them to C:\QtSDK\Desktop\Qt\4.8.1\mingw\plugins\sqldrivers and then libmysql.dll to C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin but Qt still cannot find QMYSQL driver. I followed the instructions in Qt Project but it does not work.

Similar Threads

  1. Help with QMYSQL driver for QT 4.4.0: driver not loaded
    By khikho in forum Installation and Deployment
    Replies: 4
    Last Post: 1st April 2011, 15:00
  2. QMYSQL driver not loaded
    By cydside in forum Qt Programming
    Replies: 4
    Last Post: 31st March 2010, 02:18
  3. QMYSQL driver
    By pcaeiro in forum Qt Programming
    Replies: 2
    Last Post: 3rd September 2009, 14:35
  4. QMYSQL driver not loaded
    By sepehr in forum Qt Programming
    Replies: 12
    Last Post: 11th January 2009, 20:15
  5. QMYSQL driver
    By Fastman in forum Installation and Deployment
    Replies: 2
    Last Post: 26th October 2007, 08:14

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.