PDA

View Full Version : Issue Installing QMYSQL Driver



X3R4CK3R
27th May 2013, 05:32
Hi, I need to use Mysql in Qt, so I found how to install the QMYSQL driver in this guide (http://www.qtcentre.org/wiki/index.php?title=Building_the_QMYSQL_plugin_on_Wind ows_using_MinGW).

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:


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"

C:\Qt\4.8.4\src\plugins\sqldrivers\mysql>make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Qt/4.8.4/src/plugins/sqldrivers/mysql'
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
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
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
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
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
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
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
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
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-
~1.90-/lib/opt/liblibmysql.a -lQtSqld4 -lQtCored4
Creating library file: debug\libqsqlmysqld4.a
mingw32-make[1]: Leaving directory `C:/Qt/4.8.4/src/plugins/sqldrivers/mysql'

C:\Qt\4.8.4\src\plugins\sqldrivers\mysql>

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.

X3R4CK3R
27th May 2013, 06:40
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:


27/05/2013 06:34 <DIR> .
27/05/2013 06:34 <DIR> ..
26/11/2012 13:54 2.168 libqsqlite4.a
26/11/2012 13:54 2.178 libqsqlited4.a
27/05/2013 06:31 2.182 libqsqlmysql4.a
27/05/2013 06:29 2.192 libqsqlmysqld4.a
26/11/2012 13:53 2.178 libqsqlodbc4.a
26/11/2012 13:53 2.182 libqsqlodbcd4.a
26/11/2012 13:54 529.408 qsqlite4.dll
26/11/2012 13:54 1.898.887 qsqlited4.dll
27/05/2013 06:31 80.896 qsqlmysql4.dll
27/05/2013 06:29 782.587 qsqlmysqld4.dll
26/11/2012 13:53 164.352 qsqlodbc4.dll
26/11/2012 13:53 999.200 qsqlodbcd4.dll
I tried to:

qDebug() << QSqlDatabase::drivers(); // returns me only ("QSQLITE", "QODBC3", "QODBC")