QMYSQL多次尝试,仍然没有创建库文件?

时间:2012-12-25 05:03:59

标签: mysql qt driver

所以我已经阅读了几个如何在QT中正确安装QYMYSQL驱动程序的指南,我甚至阅读了与其他指令相矛盾的指令....所以非常恼火。无论如何,我已经到了我的舞台 ...src\plugins\sqldrivers\mysql目录我有这些文件/标题... mysql folder

问题在于指南的下一步是简单地运行 migw32-make我应该在我的目录中准备好4个文件(.dll和.a)吗?

但是我继续得到一组错误,我不知道如何修复。以下是我尝试make命令时会发生的事情:

C:\Qt\4.8.4\src\plugins\sqldrivers\mysql>mingw32-make
mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `C:/Qt/4.8.4/src/plugins/sqldrivers/mysql'
g++ -mthreads -shared -Wl,--out-implib,c:\Qt\4.8.4\plugins\sqldrivers\libqsqlmys
qld4.a -o ..\..\..\..\plugins\sqldrivers\qsqlmysqld4.dll tmp/obj/debug_shared/ma
in.o tmp/obj/debug_shared/qsql_mysql.o tmp/obj/debug_shared/moc_qsql_mysql.o  -L
"c:\Qt\4.8.4\lib" -L"c:\Qt\4.8.4\lib" tmp\obj\debug_shared\qsqlmysqld_resource_r
es.o C:\MYSQL\lib\libmysql.lib -lQtSqld4 -lQtCored4
Creating library file: c:\Qt\4.8.4\plugins\sqldrivers\libqsqlmysqld4.a
tmp/obj/debug_shared/qsql_mysql.o: In function `codec':
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:223: undefined reference to `mysql_character_set_name@4'
tmp/obj/debug_shared/qsql_mysql.o: In function `qMakeError':
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:234: undefined reference to `mysql_error@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:237: undefined reference to `mysql_errno@4'
tmp/obj/debug_shared/qsql_mysql.o: In function `qMakeStmtError':
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:309: undefined reference to `mysql_stmt_error@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:312: undefined reference to `mysql_stmt_errno@4'
tmp/obj/debug_shared/qsql_mysql.o: In function `ZN19QMYSQLResultPrivate12bindInV
aluesEv':
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:358: undefined reference to `mysql_stmt_result_metadata@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:362: undefined reference to `mysql_num_fields@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:369: undefined reference to `mysql_fetch_field@4'
tmp/obj/debug_shared/qsql_mysql.o: In function `ZN12QMYSQLResult7cleanupEv':
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:432: undefined reference to `mysql_free_result@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:438: undefined reference to `mysql_store_result@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:440: undefined reference to `mysql_free_result@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:437: undefined reference to `mysql_next_result@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:446: undefined reference to `mysql_stmt_close@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:452: undefined reference to `mysql_free_result@4'
tmp/obj/debug_shared/qsql_mysql.o: In function `ZN12QMYSQLResult5fetchEi':
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:496: undefined reference to `mysql_stmt_data_seek@12'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:498: undefined reference to `mysql_stmt_fetch@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:513: undefined reference to `mysql_data_seek@12'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:514: undefined reference to `mysql_fetch_row@4'
tmp/obj/debug_shared/qsql_mysql.o: In function `ZN12QMYSQLResult9fetchNextEv':
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:529: undefined reference to `mysql_stmt_fetch@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:544: undefined reference to `mysql_fetch_row@4'
tmp/obj/debug_shared/qsql_mysql.o: In function `ZN12QMYSQLResult9fetchLastEv':
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:565: undefined reference to `mysql_stmt_num_rows@4'
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:570: undefined reference to `mysql_num_rows@4'
tmp/obj/debug_shared/qsql_mysql.o: In function `ZN12QMYSQLResult4dataEi':
C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:614: undefined reference to `mysql_fetch_lengths@4'
tmp/obj/debug_shared/qsql_mysql.o: In function `ZN12QMYSQLResult5resetERK7QString':

它以类似的模式重复,直到它结束:

C:\Qt\4.8.4\src\plugins\sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.c
pp:1516: undefined reference to `mysql_real_escape_string@16'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlmysqld4.dll] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.8.4/src/plugins/sqldrivers/mysql'
mingw32-make: *** [debug-all] Error 2

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

我不知道我做错了什么,或者我应该重新安装并遵循不同的安装指南,因为有这么多。我真的很感激,如果有人能告诉我为什么会窒息或指向我一个可信的安装指南并且确实有效

提前致谢

更新已解决

我并没有真正弄清楚问题是什么,但猜测它与不兼容性有关...无论如何我通过使用不同的mysql安装文件来解决它,它附带了另一个软件,Xampp,我安装了很多虽然我现在可以使用Qt的QMYSQL插件,它工作正常!!!

0 个答案:

没有答案