Results 1 to 2 of 2

Thread: Issue Installing QMYSQL Driver

  1. #1
    Join Date
    May 2013
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Issue Installing QMYSQL Driver

    Hi, I need to use Mysql in Qt, so I found how to install the QMYSQL driver in this guide.

    I tried with the last version of MySQL Server (5.6), but when I tried to make, I got a lot of undefined errors, trying with older versions, I could finally build the libraries (I used mysql-noinstall-5.0.90-win32.zip) in the debug folder, and the libraries are qsqlmysqld4.dll and libqsqlmysqld4.a, when the guide says:

    Run make - this should build the qsqlmysql4.dll, libqsqlmysqld4.dll, qsqlmysql4.a and libqsqlmysqld4.a files in the %QTDIR%/plugins/sqldrivers directory.
    What's wrong?

    There's the build log:

    Qt Code:
    1. C:\Qt\4.8.4\src\plugins\sqldrivers\mysql>qmake -o Makefile "INCLUDEPATH+=C:/Progra~2/MySQL/MYSQL-~1.90-/include" "LIBS+=C:/Progra~2/MySQL/MYSQL-~1.90-/lib/opt/liblibmysql.a"
    2.  
    3. C:\Qt\4.8.4\src\plugins\sqldrivers\mysql>make
    4. mingw32-make -f Makefile.Debug
    5. mingw32-make[1]: Entering directory `C:/Qt/4.8.4/src/plugins/sqldrivers/mysql'
    6. g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -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"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\Progra~2\MySQL\MYSQL-~1.90-\include" -I"..\..\..\..\include\ActiveQt" -I"debug" -I"..\..\..\..\mkspecs\win32-g++" -o debug\main.o main.cpp
    7. C:\Qt\4.8.4\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"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\Progra~2\MySQL\MYSQL-~1.90-\include" -I"..\..\..\..\include\ActiveQt" -I"debug" -I"..\..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.cpp -o debug\qsql_mysql.moc
    8. g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -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"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\Progra~2\MySQL\MYSQL-~1.90-\include" -I"..\..\..\..\include\ActiveQt" -I"debug" -I"..\..\..\..\mkspecs\win32-g++" -o debug\qsql_mysql.o ..\..\..\sql\drivers\mysql\qsql_mysql.cpp
    9. C:\Qt\4.8.4\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_HA
    10. VE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\Progra~2\MySQL\MYSQL-~1.90-\include" -I"..\..\..\..\include\ActiveQt" -I"debug" -I"..\..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.h -o debug\moc_qsql_mysql.cpp
    11. g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -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 -DQ
    12. T_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\Progra~2\MySQL\MYSQL-~1.90-\include" -I"..\..\..\..\include\ActiveQt" -I"debug" -I"..\..\..\..\mkspecs\win32-g++" -o debug\moc_qsql_mysql.o debug\moc_qsql_mysql.cpp
    13. 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
    14. 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:\Qt\4.8.4\lib" debug\qsqlmysqld_resource_res.o C:/Progra~2/MySQL/MYSQL-
    15. ~1.90-/lib/opt/liblibmysql.a -lQtSqld4 -lQtCored4
    16. Creating library file: debug\libqsqlmysqld4.a
    17. mingw32-make[1]: Leaving directory `C:/Qt/4.8.4/src/plugins/sqldrivers/mysql'
    18.  
    19. C:\Qt\4.8.4\src\plugins\sqldrivers\mysql>
    To copy to clipboard, switch view to plain text mode 

    PD: I could build the libraries thanks to a guy who had the same problem and said that he solved it with MySQL 32bits, while 64bits broughts him problems. But as I said, I don't get the libraries which I need.

    I've installed Qt 4.8.4 SDK under Code::Blocks and Windows 7 Ultimate 64-bits.

    Sorry if bad english and sorry if there isn't the appropriate forum. Best regards.
    Last edited by X3R4CK3R; 27th May 2013 at 05:45.

  2. #2
    Join Date
    May 2013
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Issue Installing QMYSQL Driver

    Well, I tried "make release" and now I get qsqlmysql4.dll and libqsqlmysql4.lib in the release folder, I copy them into plugins folder but Qt doesn't load it.

    the guides says what when I type "make" in the Qt command prompt, the libraries should appear in the plugin folder, but it doesn't, it only makes it on debug or release folder.

    There is my C:\Qt\4.8.4\plugins\sqldrivers folder:
    Qt Code:
    1. 27/05/2013 06:34 <DIR> .
    2. 27/05/2013 06:34 <DIR> ..
    3. 26/11/2012 13:54 2.168 libqsqlite4.a
    4. 26/11/2012 13:54 2.178 libqsqlited4.a
    5. 27/05/2013 06:31 2.182 libqsqlmysql4.a
    6. 27/05/2013 06:29 2.192 libqsqlmysqld4.a
    7. 26/11/2012 13:53 2.178 libqsqlodbc4.a
    8. 26/11/2012 13:53 2.182 libqsqlodbcd4.a
    9. 26/11/2012 13:54 529.408 qsqlite4.dll
    10. 26/11/2012 13:54 1.898.887 qsqlited4.dll
    11. 27/05/2013 06:31 80.896 qsqlmysql4.dll
    12. 27/05/2013 06:29 782.587 qsqlmysqld4.dll
    13. 26/11/2012 13:53 164.352 qsqlodbc4.dll
    14. 26/11/2012 13:53 999.200 qsqlodbcd4.dll
    To copy to clipboard, switch view to plain text mode 
    I tried to:
    Qt Code:
    1. qDebug() << QSqlDatabase::drivers(); // returns me only ("QSQLITE", "QODBC3", "QODBC")
    To copy to clipboard, switch view to plain text mode 
    Last edited by X3R4CK3R; 27th May 2013 at 05:44.

Similar Threads

  1. Huge problems while installing QMYSQL driver
    By ZikO in forum Installation and Deployment
    Replies: 4
    Last Post: 21st August 2012, 19:56
  2. 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
  3. Replies: 5
    Last Post: 22nd October 2010, 15:54
  4. QMYSQL driver
    By pcaeiro in forum Qt Programming
    Replies: 2
    Last Post: 3rd September 2009, 14:35
  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.