2011-03-14 58 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服务。