2011-03-14 41 views
0

建設的MySQL插件我這裏有以建設MySQL驅動程序使用Qt 4.7.2問題與Qt的4.7.2

我已經安裝的Qt 4.7.2 VS2008和MySQL 5.5.9社區版的連接體問題,無論是在沒有空格的路徑(C:\ Qt中,C:\ MySQL的)。 我把從Qt的文檔的命令和創建Makefile文件都沒有問題,只有消息:

C:\Qt\4.7.2\src\plugins\sqldrivers\mysql>C:\Qt\4.7.2\bin\qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\lib\libmysql.lib" mysql.pro 
WARNING: (internal):1: Unescaped backslashes are deprecated. 
WARNING: (internal):1: Unescaped backslashes are deprecated. 
WARNING: (internal):1: Unescaped backslashes are deprecated. 

然後我運行NMAKE,並得到以下結果:

C:\Qt\4.7.2\src\plugins\sqldrivers\mysql>nmake 

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 
Copyright (C) Microsoft Corporation. All rights reserved. 

     "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" -f Makefile.Debug 

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 
Copyright (C) Microsoft Corporation. All rights reserved. 

     C:\Qt\4.7.2\bin\moc.exe -DUNICODE -DWIN32 -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:\MySQL\include" -I"..\..\..\..\include\ActiveQt 
" -I"debug" -I"..\..\..\..\mkspecs\default" -D_MSC_VER=1500 -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.cpp -o debug\qsql_mysql.moc 
     C:\Qt\4.7.2\bin\moc.exe -DUNICODE -DWIN32 -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:\MySQL\include" -I"..\..\..\..\include\ActiveQt 
" -I"debug" -I"..\..\..\..\mkspecs\default" -D_MSC_VER=1500 -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.h -o debug\moc_qsql_mysql.cpp 
     rc -D_DEBUG -DUNICODE -DWIN32 -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 -fo debug\qsqlmysqld_resource.res qsqlmysqld_resource.rc 
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1 
Copyright (C) Microsoft Corporation. All rights reserved. 

     cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LI 
B -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:\MySQL\include" -I"..\..\..\..\include\ActiveQt" -I"debug" -I"..\..\..\..\mkspecs\default" -Fodebug\ @C:\Users\MASTER~1\AppData\Local\Temp\nmF5B5.tmp 
main.cpp 
     cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LI 
B -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:\MySQL\include" -I"..\..\..\..\include\ActiveQt" -I"debug" -I"..\..\..\..\mkspecs\default" -Fodebug\ @C:\Users\MASTER~1\AppData\Local\Temp\nmFE8C.tmp 
qsql_mysql.cpp 
     cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LI 
B -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:\MySQL\include" -I"..\..\..\..\include\ActiveQt" -I"debug" -I"..\..\..\..\mkspecs\default" -Fodebug\ @C:\Users\MASTER~1\AppData\Local\Temp\nm6E7.tmp 
moc_qsql_mysql.cpp 
     link /LIBPATH:"c:\Qt\4.7.2\lib" /NOLOGO /DEBUG /DLL /MANIFEST /MANIFESTFILE:"debug\qsqlmysqld.intermediate.manifest" /VERSION:4.72 /OUT:debug\qsqlmysqld4.dll @C:\Users\MASTER~1\AppData\Local\T 
emp\nmE28.tmp 
    Creating library debug\qsqlmysqld4.lib and object debug\qsqlmysqld4.exp 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: bool __thiscall QMYSQLResultPrivate::bindInValues(void)" ([email protected] 
[email protected]@QAE_NXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: bool __thiscall QMYSQLResultPrivate::bindInValues(void)" ([email protected] 
[email protected]@QAE_NXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: bool __thiscall QMYSQLResultPrivate::bindInValues(void)" ([email protected] 
[email protected]@QAE_NXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: void __thiscall QMYSQLResult::cleanup(void)" ([email protected]@@IAEXXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: void __thiscall QMYSQLResult::cleanup(void)" ([email protected]@@IAEXXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: void __thiscall QMYSQLResult::cleanup(void)" ([email protected]@@IAEXXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: void __thiscall QMYSQLResult::cleanup(void)" ([email protected]@@IAEXXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch(int)" ([email protected]@@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch(int)" ([email protected]@@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch(int)" ([email protected]@@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch(int)" ([email protected]@@[email protected]) 

qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "class QSqlError __cdecl qMakeStmtError(class QString const &,enum QSqlError::ErrorType,struct st_ 
mysql_stmt *)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "class QSqlError __cdecl qMakeStmtError(class QString const &,enum QSqlError::ErrorType,struct st_ 
mysql_stmt *)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::fetchLast(void)" ([email protected]@@MAE_NXZ 
) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::fetchLast(void)" ([email protected]@@MA 
E_NXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual class QVariant __thiscall QMYSQLResult::data(int)" ([email protected]@@MAE 
[email protected]@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::reset(class QString const &)" ([email protected] 
[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::reset(class QString const &)" ([email protected] 
[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::reset(class QString const &)" ([email protected] 
[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::reset(class QString const &)" ([email protected] 
[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "class QSqlError __cdecl qMakeError(class QString const &,enum QSqlError::ErrorType,class QMYSQLDriverP 
rivate const *)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "class QSqlError __cdecl qMakeError(class QString const &,enum QSqlError::ErrorType,class QMYSQLDriverP 
rivate const *)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual class QVariant __thiscall QMYSQLResult::lastInsertId(void)const " (?lastInsertI 
[email protected]@@[email protected]@XZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual class QVariant __thiscall QMYSQLResult::lastInsertId(void)const " (?lastIn 
[email protected]@@MB[email protected]@XZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual class QSqlRecord __thiscall QMYSQLResult::record(void)const " ([email protected] 
[email protected]@[email protected]@XZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::prepare(class QString const &)" ([email protected] 
[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::prepare(class QString const &)" ([email protected] 
[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::prepare(class QString const &)" ([email protected] 
[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::exec(void)" ([email protected]@@MAE_NXZ) 

qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::exec(void)" ([email protected]@@MAE_NXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::exec(void)" ([email protected]@@MAE_NXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::exec(void)" ([email protected]@@MAE_NXZ 
) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::exec(void)" ([email protected]@@MAE_NXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::exec(void)" ([email protected]@@MAE_NXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::exec(void)" ([email protected]@@MAE_NXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "class QTextCodec * __cdecl codec(struct st_mysql *)" ([email protected]@[email protected]@PAUst_mysq 
[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QString const &,class QString const &,c 
lass QString const &,class QString const &,int,class QString const &)" ([email protected]@@[email protected]@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QString const &,class QString co 
nst &,class QString const &,class QString const &,int,class QString const &)" ([email protected]@@[email protected]@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QString const &,class QString co 
nst &,class QString const &,class QString const &,int,class QString const &)" ([email protected]@@[email protected]@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QString const &,class QString con 
st &,class QString const &,class QString const &,int,class QString const &)" ([email protected]@@[email protected]@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QString const &,class QString const &,clas 
s QString const &,class QString const &,int,class QString const &)" ([email protected]@@[email protected]@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QString const &,class QString const &,class Q 
String const &,class QString const &,int,class QString const &)" ([email protected]@@[email protected]@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QString const &,class QString const &,cla 
ss QString const &,class QString const &,int,class QString const &)" ([email protected]@@[email protected]@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QString const &,class QString const & 
,class QString const &,class QString const &,int,class QString const &)" ([email protected]@@[email protected]@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QString const &,class QString const &,class QS 
tring const &,class QString const &,int,class QString const &)" ([email protected]@@[email protected]@[email protected]) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual void __thiscall QMYSQLDriver::close(void)" ([email protected]@@UAEXXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual class QStringList __thiscall QMYSQLDriver::tables(enum QSql::TableType)const " (
[email protected]@@[email protected]@[email protected]@@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual class QSqlRecord __thiscall QMYSQLDriver::record(class QString const &)const " 
([email protected]@@[email protected]@[email protected]@@Z) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual bool __thiscall QMYSQLDriver::beginTransaction(void)" ([email protected] 
[email protected]@MAE_NXZ) 
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual class QString __thiscall QMYSQLDriver::formatValue(class QSqlField const 
&,bool)const " ([email protected]@@[email protected]@[email protected]@[email protected]) 
debug\qsqlmysqld4.dll : fatal error LNK1120: 50 unresolved externals 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.EXE"' : return code '0x460' 
Stop. 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2' 
Stop. 

在了Qt -Doc是MySQL庫的另一個路徑,但是我改變了它。我沒有選擇路徑,在libaries該文件夾中的上方。

我試圖在VS2008/2010命令提示符下構建插件,沒有任何區別。

希望有人能幫助我,謝謝

+0

與舊版本的MySQL相同。 Google只能用mingw找到相關主題。 – MasterMito 2011-03-15 13:49:46

+0

解決了這一問題:安裝了MySQL,服務器的32位版本。現在它工作正常。 – MasterMito 2011-03-16 14:32:01

回答

0

MasterMito找到解決方案himself

解決了這一問題:安裝了MySQL,服務器的32位版本。

1

安裝32位版本解決了我的問題。 但是,這樣做確保已安裝的版本完全去除和MySQL服務沒有運行。你可以從任務管理器 - >服務中查看。如果服務已經運行,您可以停止服務。

執行實例配置時,安裝mysql-5.5.33-win32.msi時總會導致掛起。所以,我安裝了zip並手動啓動了mysql服務。