Issues with QMYSQL driver on Windows/MariaDB
-
So I need to get another version of libmysql.dll which is compiled with MinGW? I found these instructions:
1) Creating the MySQL client library. Unfortunatly, the client libraries (libmysql.ddl and libmysql.lib) shipped with MySQL are compiled with the M$ compiler and are causing problems with try to link them with the MinGW compiler. Therefore, we first need to create a MinGW compatible library out of libmysql.dll. This can be done by taking the following steps: 1.cd c:\mysql\lib\opt (c:\mysql is where our MySQL is installed) 2.reimp -d libmysql.lib (reimp comes with MinGW utilities) 3.dlltool -k –input-def libmysql.def –dllname libmysql.dll –output-lib libmysql.a (http://zhucongqi.cn/blog/2012-04-19-building-the-mysql-driver-for-qt4(mingw)/)
dlltool is included in C:\Qt\Tools\mingw492_32\bin. But reimp is missing although it seems to say it should be included with MinGW.
-
I tried to compile the source code but it failed with this message:
"In file included from main.cpp:36:0:
../../../sql/drivers/mysql/qsql_mysql_p.h:55:19: fatal error: mysql.h: No such file or directory
#include <mysql.h>"But I do have the file mysql.h:
C:\Program Files\MariaDB 10.1\include\mysql>dir mysql.h
...
2015-11-20 18:08 39 069 mysql.h
...And I Included the path with:
qmake "INCLUDEPATH+=C:\Program Files\MariaDB 10.1\include" "LIBS+=C:\Program Files\MariaDB 10.1\lib\libmysql.lib" mysql.proI also tried qmake "INCLUDEPATH+=C:\Program Files\MariaDB 10.1\include\mysql", and / and two \ instead of one backslash.
Can you see what could be wrong here?
C:\Qt\5.6\Src\qtbase\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=C:\Program Files\MariaDB 10.1\include" "LIBS+=C:\Program Fil es\MariaDB 10.1\lib\libmysql.lib" mysql.pro C:\Qt\5.6\Src\qtbase\src\plugins\sqldrivers\mysql>mingw32-make.exe mingw32-make.exe -f Makefile.Release all mingw32-make.exe[1]: Entering directory 'C:/Qt/5.6/Src/qtbase/src/plugins/sqldrivers/mysql' g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++1y -fno-exceptions -frtti -Wall -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_N O_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -IC:/utils/postgresql/pgsql/include -IC:/utils/my_sql/my_sql/include -IC:/openssl/include -IC:\Program -IFiles\MariaDB -I10.1\include -IC:\Qt\5.6\mingw49_32\include\Q tSql\5.6.1 -IC:\Qt\5.6\mingw49_32\include\QtSql\5.6.1\QtSql -IC:\Qt\5.6\mingw49_32\include\QtCore\5.6.1 -IC:\Qt\5.6\mingw49_32\inc lude\QtCore\5.6.1\QtCore -IC:\Qt\5.6\mingw49_32\include -IC:\Qt\5.6\mingw49_32\include\QtSql -IC:\Qt\5.6\mingw49_32\include\QtCore -I.moc\release -I..\..\..\..\mkspecs\win32-g++ -o .obj\release\main.o main.cpp In file included from main.cpp:36:0: ../../../sql/drivers/mysql/qsql_mysql_p.h:55:19: fatal error: mysql.h: No such file or directory #include <mysql.h> ^ compilation terminated. Makefile.Release:468: recipe for target '.obj/release/main.o' failed mingw32-make.exe[1]: *** [.obj/release/main.o] Error 1 mingw32-make.exe[1]: Leaving directory 'C:/Qt/5.6/Src/qtbase/src/plugins/sqldrivers/mysql' makefile:38: recipe for target 'release-all' failed mingw32-make.exe: *** [release-all] Error 2
-
Windows and paths with spaces don't mix well for development. You should rather install MariaDB in a path without any space. That will save you a whole lot of trouble.
-
I tried with QODBC and this worked! Because I reinstalled Qt I got QODBC which wasn't in the previous version, I think. Followed these instructions to first install DSN from MySQL (32 bit, the 64 bit seemed not to work).
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC"); db.setDatabaseName("Driver={MySQL ODBC 5.3 Unicode Driver};DATABASE=dbname;"); db.setUserName("root"); db.setPassword("mypassword");
Unless I can get the QMYSQL to work this may be an acceptable workaround. Perhaps if someone else has problem with QMYSQL they could try with QODBC from the new Qt version.
-
@ael16 said:
I tried to compile the source code but it failed with this message:
"In file included from main.cpp:36:0:
../../../sql/drivers/mysql/qsql_mysql_p.h:55:19: fatal error: mysql.h: No such file or directory
#include <mysql.h>"But I do have the file mysql.h:
C:\Program Files\MariaDB 10.1\include\mysql>dir mysql.h
...
2015-11-20 18:08 39 069 mysql.h
...And I Included the path with:
qmake "INCLUDEPATH+=C:\Program Files\MariaDB 10.1\include" "LIBS+=C:\Program Files\MariaDB 10.1\lib\libmysql.lib" mysql.proI also tried qmake "INCLUDEPATH+=C:\Program Files\MariaDB 10.1\include\mysql", and / and two \ instead of one backslash.
Can you see what could be wrong here?
C:\Qt\5.6\Src\qtbase\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=C:\Program Files\MariaDB 10.1\include" "LIBS+=C:\Program Fil es\MariaDB 10.1\lib\libmysql.lib" mysql.pro C:\Qt\5.6\Src\qtbase\src\plugins\sqldrivers\mysql>mingw32-make.exe mingw32-make.exe -f Makefile.Release all mingw32-make.exe[1]: Entering directory 'C:/Qt/5.6/Src/qtbase/src/plugins/sqldrivers/mysql' g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++1y -fno-exceptions -frtti -Wall -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_N O_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -IC:/utils/postgresql/pgsql/include -IC:/utils/my_sql/my_sql/include -IC:/openssl/include -IC:\Program -IFiles\MariaDB -I10.1\include -IC:\Qt\5.6\mingw49_32\include\Q tSql\5.6.1 -IC:\Qt\5.6\mingw49_32\include\QtSql\5.6.1\QtSql -IC:\Qt\5.6\mingw49_32\include\QtCore\5.6.1 -IC:\Qt\5.6\mingw49_32\inc lude\QtCore\5.6.1\QtCore -IC:\Qt\5.6\mingw49_32\include -IC:\Qt\5.6\mingw49_32\include\QtSql -IC:\Qt\5.6\mingw49_32\include\QtCore -I.moc\release -I..\..\..\..\mkspecs\win32-g++ -o .obj\release\main.o main.cpp In file included from main.cpp:36:0: ../../../sql/drivers/mysql/qsql_mysql_p.h:55:19: fatal error: mysql.h: No such file or directory #include <mysql.h> ^ compilation terminated. Makefile.Release:468: recipe for target '.obj/release/main.o' failed mingw32-make.exe[1]: *** [.obj/release/main.o] Error 1 mingw32-make.exe[1]: Leaving directory 'C:/Qt/5.6/Src/qtbase/src/plugins/sqldrivers/mysql' makefile:38: recipe for target 'release-all' failed mingw32-make.exe: *** [release-all] Error 2
Change it to below and re-test:
#include <mysql/mysql.h>"
-
@ael16, sorry, I misread your setup.
As @Hamed-Masafi indirectly pointed, your INCLUDEPATH statement doesn't include the
mysql
folder underinclude
. That's why the header wasn't found in the first place.But still, the recommendation about spaces in path holds for Windows, it's usually at link time that the trouble begins.
-
Unfortunately it didn't help.
I changed C:\Qt\5.6\Src\qtbase\src\sql\drivers\mysql\qsql_mysql_p.h to #include <mysql/mysql.h>
Then qmake:
C:\Qt\5.6\Src\qtbase\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=C:/Program Files/MariaDB 10.1/include" "LIBS+=C:/Program Files/MariaDB 10.1/lib/libmysql.lib" mysql.proNow my Makefile has this row:
$(QMAKE) "INCLUDEPATH+=C:/Program Files/MariaDB 10.1/include" "LIBS+=C:/Program Files/MariaDB 10.1/lib/libmysql.lib" -o Makefile mysql.proThen make complains about No such file or directory #include <mysql/mysql.h>:
C:\Qt\5.6\Src\qtbase\src\plugins\sqldrivers\mysql>mingw32-make.exe mingw32-make.exe -f Makefile.Release all mingw32-make.exe[1]: Entering directory 'C:/Qt/5.6/Src/qtbase/src/plugins/sqldrivers/mysql' g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++1y -fno-exceptions -frtti -Wall -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_N O_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -IC:/utils/postgresql/pgsql/include -IC:/utils/my_sql/my_sql/include -IC:/openssl/include -IC:/Program -IFiles/MariaDB -I10.1/include -IC:\Qt\5.6\mingw49_32\include\Q tSql\5.6.1 -IC:\Qt\5.6\mingw49_32\include\QtSql\5.6.1\QtSql -IC:\Qt\5.6\mingw49_32\include\QtCore\5.6.1 -IC:\Qt\5.6\mingw49_32\inc lude\QtCore\5.6.1\QtCore -IC:\Qt\5.6\mingw49_32\include -IC:\Qt\5.6\mingw49_32\include\QtSql -IC:\Qt\5.6\mingw49_32\include\QtCore -I.moc\release -I..\..\..\..\mkspecs\win32-g++ -o .obj\release\main.o main.cpp In file included from main.cpp:36:0: ../../../sql/drivers/mysql/qsql_mysql_p.h:55:25: fatal error: mysql/mysql.h: No such file or directory #include <mysql/mysql.h> ^ compilation terminated. Makefile.Release:468: recipe for target '.obj/release/main.o' failed mingw32-make.exe[1]: *** [.obj/release/main.o] Error 1 mingw32-make.exe[1]: Leaving directory 'C:/Qt/5.6/Src/qtbase/src/plugins/sqldrivers/mysql' makefile:38: recipe for target 'release-all' failed mingw32-make.exe: *** [release-all] Error 2
-
If you take a look a the the list of -I options, you'll see that each element between spaces is used. You have to quote the path itself when passing the parameter.
-
I tried on another server and got the same errors with "QMYSQL driver not loaded". But after installing the 32 bit version of MariaDB everything was ok. I will not reinstall MariaDB on the first computer atm, but this may be the error here to as I have 32 bit Qt but 64 bit MariaDB. (The new computer used MSVC though)
Thanks for pointing out the error with spaces. I tried to use many kinds of quoting but nothing seemed to work. I used the advice here with dir /x: http://seppemagiels.com/blog/create-mysql-driver-qt5-windows
qmake "INCLUDEPATH+=C:/PROGRA~1/MARIAD~1.1/include" "LIBS+=C:/PROGRA~1/MARIAD~1.1/lib/libmysql.lib" mysql.pro
This was ok. But then there was another error with make. But, as already stated, this may be solved with 32 bit MariaDB. Same error is discussed here: http://www.qtcentre.org/threads/21420-MySQL-driver-Very-strange-problem-PLEASE-HELP-ME-Thanks
But I think this can be marked solved.C:\Qt\5.6\Src\qtbase\src\plugins\sqldrivers\mysql>mingw32-make.exe mingw32-make.exe -f Makefile.Release all mingw32-make.exe[1]: Entering directory 'C:/Qt/5.6/Src/qtbase/src/plugins/sqldrivers/mysql' g++ -Wl,-s -shared -Wl,-subsystem,windows -Wl,--out-implib,C:\Qt\5.6\Src\qtbase\plugins\sqldrivers\libqsqlmysql.a -o ..\..\..\..\p lugins\sqldrivers\qsqlmysql.dll .obj/release/main.o .obj/release/qsql_mysql.o .obj/release/moc_qsql_mysql_p.o -LC:\utils\postgres ql\pgsql\lib -LC:\utils\my_sql\my_sql\lib C:\PROGRA~1\MARIAD~1.1\lib\libmysql.lib -LC:\Qt\5.6\mingw49_32\lib C:\Qt\5.6\mingw49_32\ lib\libQt5Sql.a C:\Qt\5.6\mingw49_32\lib\libQt5Core.a .obj\release\qsqlmysql_resource_res.o .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x110): undefined reference to `mysql_num_rows@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x13b): undefined reference to `mysql_stmt_num_rows@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x1da): undefined reference to `mysql_num_rows@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x207): undefined reference to `mysql_stmt_num_rows@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x24e): undefined reference to `mysql_stmt_insert_id@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x28a): undefined reference to `mysql_insert_id@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x478): undefined reference to `mysql_character_set_name@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x6b9): undefined reference to `mysql_errno@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x6d0): undefined reference to `mysql_field_seek@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x6fc): undefined reference to `mysql_field_seek@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x707): undefined reference to `mysql_fetch_field@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x74f): undefined reference to `mysql_fetch_field@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x911): undefined reference to `mysql_error@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x920): undefined reference to `mysql_errno@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xa7a): undefined reference to `mysql_errno@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xae1): undefined reference to `mysql_stmt_error@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xaee): undefined reference to `mysql_stmt_errno@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xc50): undefined reference to `mysql_fetch_row@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xc97): undefined reference to `mysql_stmt_fetch@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xdb0): undefined reference to `mysql_stmt_data_seek@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xdc1): undefined reference to `mysql_stmt_fetch@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xe2e): undefined reference to `mysql_data_seek@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xe3f): undefined reference to `mysql_fetch_row@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x12e7): undefined reference to `mysql_fetch_lengths@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2418): undefined reference to `mysql_init@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x257e): undefined reference to `mysql_ssl_set@24' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2789): undefined reference to `mysql_real_connect@32' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2894): undefined reference to `mysql_close@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2b9d): undefined reference to `mysql_set_character_set@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2bb4): undefined reference to `mysql_get_client_version@0' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2bd2): undefined reference to `mysql_thread_init@0' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2c4f): undefined reference to `mysql_real_connect@32' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2e5e): undefined reference to `mysql_ssl_set@24' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2ecb): undefined reference to `mysql_options@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2efb): undefined reference to `mysql_options@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2f2b): undefined reference to `mysql_options@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3174): undefined reference to `mysql_select_db@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x32b6): undefined reference to `mysql_close@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x32d6): undefined reference to `mysql_options@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x32f4): undefined reference to `mysql_get_server_version@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x36f4): undefined reference to `mysql_thread_end@0' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x36ff): undefined reference to `mysql_close@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3cd9): undefined reference to `mysql_list_fields@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3d36): undefined reference to `mysql_fetch_field@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3d45): undefined reference to `mysql_free_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3eda): undefined reference to `mysql_query@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x401a): undefined reference to `mysql_query@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x415a): undefined reference to `mysql_query@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x43d6): undefined reference to `mysql_get_server_version@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x47e3): undefined reference to `mysql_list_tables@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4821): undefined reference to `mysql_data_seek@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x482c): undefined reference to `mysql_fetch_row@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4914): undefined reference to `mysql_free_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4bbb): undefined reference to `mysql_num_fields@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4ca5): undefined reference to `mysql_fetch_field@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4d96): undefined reference to `mysql_stmt_result_metadata@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4dc7): undefined reference to `mysql_free_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4de8): undefined reference to `mysql_next_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4e05): undefined reference to `mysql_stmt_close@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4e2b): undefined reference to `mysql_free_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4ef0): undefined reference to `mysql_store_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x511f): undefined reference to `mysql_real_query@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5220): undefined reference to `mysql_store_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5245): undefined reference to `mysql_field_count@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5287): undefined reference to `mysql_affected_rows@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x533c): undefined reference to `mysql_fetch_field_direct@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x53bd): undefined reference to `mysql_field_count@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x557b): undefined reference to `mysql_next_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x55a3): undefined reference to `mysql_store_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x55bd): undefined reference to `mysql_field_count@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x569b): undefined reference to `mysql_free_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x56e7): undefined reference to `mysql_affected_rows@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x577b): undefined reference to `mysql_fetch_field_direct@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5944): undefined reference to `mysql_stmt_prepare@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x595d): undefined reference to `mysql_stmt_param_count@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x59dc): undefined reference to `mysql_stmt_init@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5b7a): undefined reference to `mysql_stmt_param_count@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5c29): undefined reference to `mysql_stmt_reset@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5e1a): undefined reference to `mysql_stmt_param_count@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5e33): undefined reference to `mysql_stmt_execute@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5f48): undefined reference to `mysql_stmt_affected_rows@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5f78): undefined reference to `mysql_stmt_bind_result@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5f9b): undefined reference to `mysql_stmt_store_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5fc9): undefined reference to `mysql_stmt_bind_result@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x604a): undefined reference to `mysql_stmt_param_count@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x6395): undefined reference to `mysql_stmt_bind_param@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x67fc): undefined reference to `mysql_stmt_attr_set@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x6ae9): undefined reference to `mysql_real_escape_string@16' C:/Qt/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: .obj/release/qsql_mysql.o: bad reloc address 0x4 in section `.data' collect2.exe: error: ld returned 1 exit status Makefile.Release:65: recipe for target '..\..\..\..\plugins\sqldrivers\qsqlmysql.dll' failed mingw32-make.exe[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlmysql.dll] Error 1 mingw32-make.exe[1]: Leaving directory 'C:/Qt/5.6/Src/qtbase/src/plugins/sqldrivers/mysql' makefile:38: recipe for target 'release-all' failed mingw32-make.exe: *** [release-all] Error 2
-
You can't mix architectures. While there should be no problem connecting to a 64bit running server with a 32bit client. Loading the 64bit libraries with a 32bit plugin will not work.