在Windows 7 64位中为Qt 4.8.0编译MySQL驱动程序

时间:2012-03-26 22:10:46

标签: c++ mysql qt windows-7

我是Qt的新手并尝试编译MySQL驱动程序。我尝试制作Qt CenterQt Project等等,但我没有取得任何成功。

我试过这种方式:

1)制作libmysql.a库:

cd /D D:/web/MySQL/lib
reimp -d libmysql.lib
dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a

2)使用qmake构建插件:

cd /D D:/Qt/4.8.0/src/plugins/sqldrivers/mysql
qmake "INCLUDEPATH+=D:/web/mysql/include" "LIBS+=D:/qt/mysql/lib/libmysql.a" mysql.pro

3)qmake创建了一个makefile,我试图制作:

make

在此步骤中,我收到以下错误:

mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory 'd:/Qt/488DF2~1.0/src/plugins/SQLDRI~1/mysql'
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"..\..\..\..\include\QtCore"
-I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"d:\Qt\MYSQL-~1\include" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\main.o main.cpp
D:\Qt\488DF2~1.0\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"..\..\..\..\in
clude\QtSql" -I"..\..\..\..\include" -I"d:\Qt\MYSQL-~1\include" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.cpp -o tmp\moc\debug_shared\qsql_mysql.moc
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"..\..\..\..\include\QtCore"
-I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"d:\Qt\MYSQL-~1\include" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\qsql_mysql.o ..\..\..\sql\drivers\mysql\qsql_mysql.cpp
D:\Qt\488DF2~1.0\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"..\..\..\..\in
clude\QtSql" -I"..\..\..\..\include" -I"d:\Qt\MYSQL-~1\include" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.h -o tmp\moc\debug_shared\moc_qsql_mysql.cpp
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"..\..\..\..\include\QtCore"
-I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"d:\Qt\MYSQL-~1\include" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\moc_qsql_mysql.o tmp\moc\debug_shared\moc_qsql_mysql.cpp
g++ -mthreads -shared -Wl,--out-implib,d:\Qt\488DF2~1.0\plugins\sqldrivers\libqsqlmysqld4.a -o ..\..\..\..\plugins\sqldrivers\qsqlmysqld4.dll tmp/obj/debug_shared/main.o tmp/obj/debug_shared/qsql_mysql.o tmp/obj/debug_shared/moc_qsql_mysql.o  -L"d:\Qt\488DF2~1.0\lib" -L"d:\Qt\488DF2~1.0\lib" tmp\obj
\debug_shared\qsqlmysqld_resource_res.o -lmysql -LD:/Qt/MYSQL-~1/include -LD:/Qt/MYSQL-~1/lib D:/Qt/MYSQL-~1/lib/libmysql.a -lQtSqld4 -lQtCored4
Creating library file: d:\Qt\488DF2~1.0\plugins\sqldrivers\libqsqlmysqld4.a
tmp/obj/debug_shared/qsql_mysql.o: In function 'codec':
d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:223: undefined reference to 'mysql_character_set_name@4'
tmp/obj/debug_shared/qsql_mysql.o: In function 'qMakeError':
d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:234: undefined reference to 'mysql_error@4'
d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:237: undefined reference to 'mysql_errno@4'
tmp/obj/debug_shared/qsql_mysql.o: In function 'qMakeStmtError':
d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:309: undefined reference to 'mysql_stmt_error@4'
d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:312: undefined reference to 'mysql_stmt_errno@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:358: undefined reference to 'mysql_stmt_result_metadata@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:362: undefined reference to 'mysql_num_fields@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:369: undefined reference to 'mysql_fetch_field@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:432: undefined reference to 'mysql_free_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:438: undefined reference to 'mysql_store_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:440: undefined reference to 'mysql_free_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:437: undefined reference to 'mysql_next_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:446: undefined reference to 'mysql_stmt_close@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:452: undefined reference to 'mysql_free_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:496: undefined reference to 'mysql_stmt_data_seek@12'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:498: undefined reference to 'mysql_stmt_fetch@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:513: undefined reference to 'mysql_data_seek@12'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:514: undefined reference to 'mysql_fetch_row@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:529: undefined reference to 'mysql_stmt_fetch@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:544: undefined reference to 'mysql_fetch_row@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:565: undefined reference to 'mysql_stmt_num_rows@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:570: undefined reference to 'mysql_num_rows@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:614: undefined reference to 'mysql_fetch_lengths@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:696: undefined reference to 'mysql_real_query@12'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:701: undefined reference to 'mysql_store_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:702: undefined reference to 'mysql_field_count@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:707: undefined reference to 'mysql_field_count@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:710: undefined reference to 'mysql_affected_rows@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:714: undefined reference to 'mysql_fetch_field_direct@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:728: undefined reference to 'mysql_stmt_num_rows@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:733: undefined reference to 'mysql_num_rows@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:750: undefined reference to 'mysql_stmt_insert_id@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:755: undefined reference to 'mysql_insert_id@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:775: undefined reference to 'mysql_errno@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:776: undefined reference to 'mysql_field_seek@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:777: undefined reference to 'mysql_fetch_field@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:780: undefined reference to 'mysql_fetch_field@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:783: undefined reference to 'mysql_field_seek@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:796: undefined reference to 'mysql_free_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:804: undefined reference to 'mysql_next_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:813: undefined reference to 'mysql_store_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:814: undefined reference to 'mysql_field_count@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:823: undefined reference to 'mysql_affected_rows@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:827: undefined reference to 'mysql_fetch_field_direct@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:892: undefined reference to 'mysql_stmt_init@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:900: undefined reference to 'mysql_stmt_prepare@12'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:908: undefined reference to 'mysql_stmt_param_count@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:909: undefined reference to 'mysql_stmt_param_count@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:937: undefined reference to 'mysql_stmt_reset@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:944: undefined reference to 'mysql_stmt_param_count@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:944: undefined reference to 'mysql_stmt_param_count@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1023: undefined reference to 'mysql_stmt_bind_param@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1031: undefined reference to 'mysql_stmt_execute@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1043: undefined reference to 'mysql_stmt_affected_rows@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1048: undefined reference to 'mysql_stmt_bind_result@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1055: undefined reference to 'mysql_stmt_attr_set@12'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1057: undefined reference to 'mysql_stmt_store_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1069: undefined reference to 'mysql_stmt_bind_result@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1271: undefined reference to 'mysql_init@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1271: undefined reference to 'mysql_real_connect@32'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1286: undefined reference to 'mysql_select_db@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1289: undefined reference to 'mysql_close@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1295: undefined reference to 'mysql_options@12'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1308: undefined reference to 'mysql_set_character_set@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1300: undefined reference to 'mysql_close@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1316: undefined reference to 'mysql_get_client_version@0'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1316: undefined reference to 'mysql_get_server_version@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1322: undefined reference to 'mysql_thread_init@0'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1335: undefined reference to 'mysql_thread_end@0'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1337: undefined reference to 'mysql_close@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1353: undefined reference to 'mysql_get_server_version@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1361: undefined reference to 'mysql_list_tables@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1365: undefined reference to 'mysql_data_seek@12'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1366: undefined reference to 'mysql_fetch_row@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1372: undefined reference to 'mysql_free_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1425: undefined reference to 'mysql_list_fields@12'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1431: undefined reference to 'mysql_fetch_field@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1433: undefined reference to 'mysql_free_result@4'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1451: undefined reference to 'mysql_query@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1468: undefined reference to 'mysql_query@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1485: undefined reference to 'mysql_query@8'
tmp/obj/debug_shared/qsql_mysql.o:d:\Qt\488DF2~1.0\src\plugins\SQLDRI~1\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:1511: 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 'd:/Qt/488DF2~1.0/src/plugins/SQLDRI~1/mysql'

我使用文件夹的长短名称,但这并没有改变任何东西。 我尝试使用预安装的64位MySQL社区服务器和MySQL C Connector .zip中的MySQL库。 我正在使用MySQL 5.5.21和Qt 4.8.0。 我究竟做错了什么?我被诅咒了吗?也许,Qt只是不喜欢我?

2 个答案:

答案 0 :(得分:1)

您似乎无法使用MySQL 64位版本来编译插件。下载MySql 32位版本(例如mysql-5.5.22-win32.msi)。之后我成功编译了插件。

答案 1 :(得分:0)

自从我在Windows上构建它以来已经很长时间了,但您可以尝试: qmake“INCLUDEPATH + = D:/ web / mysql / include”“LIBS + = - LD:/ qt / mysql / lib / -lmysql”mysql.pro