在nmake尝试链接到mysql库之前,似乎一切都很顺利。
C:\Qt\5.1.1\Src\qtbase>dir C:\mysql\include
Volume in drive C is OS
Volume Serial Number is A640-05EF
Directory of C:\mysql\include
10/24/2013 04:51 PM <DIR> .
10/24/2013 04:51 PM <DIR> ..
09/10/2013 09:33 AM 3,906 big_endian.h
09/10/2013 09:33 AM 4,595 byte_order_generic.h
09/10/2013 09:33 AM 3,935 byte_order_generic_x86.h
09/10/2013 09:33 AM 3,415 byte_order_generic_x86_64.
09/10/2013 09:33 AM 4,593 decimal.h
09/10/2013 09:33 AM 3,593 errmsg.h
09/10/2013 09:33 AM 6,478 keycache.h
09/10/2013 09:33 AM 2,810 little_endian.h
10/24/2013 04:51 PM <DIR> mysql
09/10/2013 09:33 AM 28,458 mysql.h
09/10/2013 09:50 AM 94,133 mysqld_ername.h
09/10/2013 09:50 AM 35,257 mysqld_error.h
09/10/2013 09:33 AM 23,005 mysql_com.h
09/10/2013 09:33 AM 713 mysql_com_server.h
09/10/2013 09:33 AM 585 mysql_embed.h
09/10/2013 09:33 AM 1,588 mysql_time.h
09/10/2013 09:49 AM 947 mysql_version.h
09/10/2013 09:33 AM 1,324 my_alloc.h
09/10/2013 09:33 AM 1,501 my_attribute.h
09/10/2013 09:33 AM 1,379 my_byteorder.h
09/10/2013 09:33 AM 3,636 my_compiler.h
09/10/2013 09:44 AM 17,555 my_config.h
09/10/2013 09:33 AM 7,603 my_dbug.h
09/10/2013 09:33 AM 2,973 my_dir.h
09/10/2013 09:33 AM 5,479 my_getopt.h
09/10/2013 09:33 AM 32,689 my_global.h
09/10/2013 09:33 AM 906 my_list.h
09/10/2013 09:33 AM 1,465 my_net.h
09/10/2013 09:33 AM 30,841 my_pthread.h
09/10/2013 09:33 AM 40,406 my_sys.h
09/10/2013 09:33 AM 2,216 my_xml.h
09/10/2013 09:33 AM 32,849 m_ctype.h
09/10/2013 09:33 AM 8,938 m_string.h
09/10/2013 09:33 AM 23,601 plugin.h
09/10/2013 09:33 AM 3,541 plugin_audit.h
09/10/2013 09:33 AM 6,989 plugin_ftparser.h
09/10/2013 09:33 AM 976 plugin_validate_password.h
09/10/2013 09:33 AM 4,225 sql_common.h
09/10/2013 09:50 AM 13,559 sql_state.h
09/10/2013 09:33 AM 750 sslopt-case.h
09/10/2013 09:33 AM 1,956 sslopt-longopts.h
09/10/2013 09:33 AM 767 sslopt-vars.h
09/10/2013 09:33 AM 1,678 typelib.h
42 File(s) 467,813 bytes
3 Dir(s) 73,573,339,136 bytes free
C:\Qt\5.1.1\Src\qtbase>dir C:\mysql\lib
Volume in drive C is OS
Volume Serial Number is A640-05EF
Directory of C:\mysql\lib
10/24/2013 04:51 PM <DIR> .
10/24/2013 04:51 PM <DIR> ..
10/24/2013 04:51 PM <DIR> debug
09/10/2013 09:52 AM 5,425,152 libmysql.dll
09/10/2013 09:52 AM 27,538 libmysql.lib
09/10/2013 09:51 AM 8,807,170 mysqlclient.lib
10/24/2013 04:51 PM <DIR> plugin
3 File(s) 14,259,860 bytes
4 Dir(s) 73,573,335,040 bytes free
C:\Qt\5.1.1\Src\qtbase>configure -I C:\mysql\include -L C:\mysql\lib -plugin-sql
-mysql -opengl desktop
-------------------------------------- SNIP -------- -----------------------------------
Sql Drivers:
ODBC....................no
MySQL...................plugin
OCI.....................no
PostgreSQL..............no
TDS.....................no
DB2.....................no
SQLite..................plugin (qt)
SQLite2.................no
InterBase...............no
Sources are in..............C:\Qt\5.1.1\Src\qtbase
Build is done in............C:\Qt\5.1.1\Src\qtbase
Install prefix..............C:\Qt\5.1.1\Src\qtbase
Headers installed to........C:\Qt\5.1.1\Src\qtbase\include
Libraries installed to......C:\Qt\5.1.1\Src\qtbase\lib
Arch-dep. data to...........C:\Qt\5.1.1\Src\qtbase
Plugins installed to........C:\Qt\5.1.1\Src\qtbase\plugins
Library execs installed to..C:\Qt\5.1.1\Src\qtbase\bin
QML1 imports installed to...C:\Qt\5.1.1\Src\qtbase\imports
QML2 imports installed to...C:\Qt\5.1.1\Src\qtbase\qml
Binaries installed to.......C:\Qt\5.1.1\Src\qtbase\bin
Arch-indep. data to.........C:\Qt\5.1.1\Src\qtbase
Docs installed to...........C:\Qt\5.1.1\Src\qtbase\doc
Translations installed to...C:\Qt\5.1.1\Src\qtbase\translations
Examples installed to.......C:\Qt\5.1.1\Src\qtbase\examples
Tests installed to..........C:\Qt\5.1.1\Src\qtbase\tests
Include paths...............C:\mysql\include
Additional libraries........-LC:\mysql\lib
Generating Makefiles...
Qt is now configured for building. Just run nmake.
To reconfigure, run nmake confclean and configure.
C:\Qt\5.1.1\Src\qtbase>nmake
-------------------------------------- SNIP -------- -----------------------------------
echo 2 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "..
\\..\\..\\..\\plugins\\sqldrivers\\qsqlmysqld.dll.embed.manifest">..\..\..\..\pl
ugins\sqldrivers\qsqlmysqld.dll_manifest.rc
if not exist ..\..\..\..\plugins\sqldrivers\qsqlmysqld.dll if exist ..\.
.\..\..\plugins\sqldrivers\qsqlmysqld.dll.embed.manifest del ..\..\..\..\plugins
\sqldrivers\qsqlmysqld.dll.embed.manifest
if exist ..\..\..\..\plugins\sqldrivers\qsqlmysqld.dll.embed.manifest co
py /Y ..\..\..\..\plugins\sqldrivers\qsqlmysqld.dll.embed.manifest ..\..\..\..\p
lugins\sqldrivers\qsqlmysqld.dll_manifest.bak
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /MANIFEST /MANIFESTFILE:
..\..\..\..\plugins\sqldrivers\qsqlmysqld.dll.embed.manifest /OUT:..\..\..\..\pl
ugins\sqldrivers\qsqlmysqld.dll @C:\Users\Jarl\AppData\Local\Temp\nm8E4E.tmp
Creating library ..\..\..\..\plugins\sqldrivers\qsqlmysqld.lib and object ..\
..\..\..\plugins\sqldrivers\qsqlmysqld.exp
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_fetch_field@4
referenced in function "public: bool __thiscall QMYSQLResultPrivate::bindInValue
s(void)" (?bindInValues@QMYSQLResultPrivate@@QAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_num_fields@4 r
eferenced in function "public: bool __thiscall QMYSQLResultPrivate::bindInValues
(void)" (?bindInValues@QMYSQLResultPrivate@@QAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_result_me
tadata@4 referenced in function "public: bool __thiscall QMYSQLResultPrivate::bi
ndInValues(void)" (?bindInValues@QMYSQLResultPrivate@@QAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_close@4 r
eferenced in function "protected: void __thiscall QMYSQLResult::cleanup(void)" (
?cleanup@QMYSQLResult@@IAEXXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_store_result@4
referenced in function "protected: void __thiscall QMYSQLResult::cleanup(void)"
(?cleanup@QMYSQLResult@@IAEXXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_next_result@4
referenced in function "protected: void __thiscall QMYSQLResult::cleanup(void)"
(?cleanup@QMYSQLResult@@IAEXXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_free_result@4
referenced in function "protected: void __thiscall QMYSQLResult::cleanup(void)"
(?cleanup@QMYSQLResult@@IAEXXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_fetch_row@4 re
ferenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch(int
)" (?fetch@QMYSQLResult@@MAE_NH@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_data_seek@12 r
eferenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch(in
t)" (?fetch@QMYSQLResult@@MAE_NH@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_fetch@4 r
eferenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch(in
t)" (?fetch@QMYSQLResult@@MAE_NH@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_data_seek
@12 referenced in function "protected: virtual bool __thiscall QMYSQLResult::fet
ch(int)" (?fetch@QMYSQLResult@@MAE_NH@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_errno@4 r
eferenced in function "class QSqlError __cdecl qMakeStmtError(class QString cons
t &,enum QSqlError::ErrorType,struct st_mysql_stmt *)" (?qMakeStmtError@@YA?AVQS
qlError@@ABVQString@@W4ErrorType@1@PAUst_mysql_stmt@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_error@4 r
eferenced in function "class QSqlError __cdecl qMakeStmtError(class QString cons
t &,enum QSqlError::ErrorType,struct st_mysql_stmt *)" (?qMakeStmtError@@YA?AVQS
qlError@@ABVQString@@W4ErrorType@1@PAUst_mysql_stmt@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_num_rows@4 ref
erenced in function "protected: virtual bool __thiscall QMYSQLResult::fetchLast(
void)" (?fetchLast@QMYSQLResult@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_num_rows@
4 referenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch
Last(void)" (?fetchLast@QMYSQLResult@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_fetch_lengths@
4 referenced in function "protected: virtual class QVariant __thiscall QMYSQLRes
ult::data(int)" (?data@QMYSQLResult@@MAE?AVQVariant@@H@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_fetch_field_di
rect@8 referenced in function "protected: virtual bool __thiscall QMYSQLResult::
reset(class QString const &)" (?reset@QMYSQLResult@@MAE_NABVQString@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_affected_rows@
4 referenced in function "protected: virtual bool __thiscall QMYSQLResult::reset
(class QString const &)" (?reset@QMYSQLResult@@MAE_NABVQString@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_field_count@4
referenced in function "protected: virtual bool __thiscall QMYSQLResult::reset(c
lass QString const &)" (?reset@QMYSQLResult@@MAE_NABVQString@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_real_query@12
referenced in function "protected: virtual bool __thiscall QMYSQLResult::reset(c
lass QString const &)" (?reset@QMYSQLResult@@MAE_NABVQString@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_errno@4 refere
nced in function "class QSqlError __cdecl qMakeError(class QString const &,enum
QSqlError::ErrorType,class QMYSQLDriverPrivate const *)" (?qMakeError@@YA?AVQSql
Error@@ABVQString@@W4ErrorType@1@PBVQMYSQLDriverPrivate@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_error@4 refere
nced in function "class QSqlError __cdecl qMakeError(class QString const &,enum
QSqlError::ErrorType,class QMYSQLDriverPrivate const *)" (?qMakeError@@YA?AVQSql
Error@@ABVQString@@W4ErrorType@1@PBVQMYSQLDriverPrivate@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_insert_id@4 re
ferenced in function "protected: virtual class QVariant __thiscall QMYSQLResult:
:lastInsertId(void)const " (?lastInsertId@QMYSQLResult@@MBE?AVQVariant@@XZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_insert_id
@4 referenced in function "protected: virtual class QVariant __thiscall QMYSQLRe
sult::lastInsertId(void)const " (?lastInsertId@QMYSQLResult@@MBE?AVQVariant@@XZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_field_seek@8 r
eferenced in function "protected: virtual class QSqlRecord __thiscall QMYSQLResu
lt::record(void)const " (?record@QMYSQLResult@@MBE?AVQSqlRecord@@XZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_param_cou
nt@4 referenced in function "protected: virtual bool __thiscall QMYSQLResult::pr
epare(class QString const &)" (?prepare@QMYSQLResult@@MAE_NABVQString@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_prepare@1
2 referenced in function "protected: virtual bool __thiscall QMYSQLResult::prepa
re(class QString const &)" (?prepare@QMYSQLResult@@MAE_NABVQString@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_init@4 re
ferenced in function "protected: virtual bool __thiscall QMYSQLResult::prepare(c
lass QString const &)" (?prepare@QMYSQLResult@@MAE_NABVQString@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_store_res
ult@4 referenced in function "protected: virtual bool __thiscall QMYSQLResult::e
xec(void)" (?exec@QMYSQLResult@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_attr_set@
12 referenced in function "protected: virtual bool __thiscall QMYSQLResult::exec
(void)" (?exec@QMYSQLResult@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_bind_resu
lt@8 referenced in function "protected: virtual bool __thiscall QMYSQLResult::ex
ec(void)" (?exec@QMYSQLResult@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_affected_
rows@4 referenced in function "protected: virtual bool __thiscall QMYSQLResult::
exec(void)" (?exec@QMYSQLResult@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_execute@4
referenced in function "protected: virtual bool __thiscall QMYSQLResult::exec(v
oid)" (?exec@QMYSQLResult@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_bind_para
m@8 referenced in function "protected: virtual bool __thiscall QMYSQLResult::exe
c(void)" (?exec@QMYSQLResult@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_reset@4 r
eferenced in function "protected: virtual bool __thiscall QMYSQLResult::exec(voi
d)" (?exec@QMYSQLResult@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_character_set_
name@4 referenced in function "class QTextCodec * __cdecl codec(struct st_mysql
*)" (?codec@@YAPAVQTextCodec@@PAUst_mysql@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_thread_init@0
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 &)" (?open@QMYSQLDriver@@UAE_NABVQString@@000H0@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_get_server_ver
sion@4 referenced in function "public: virtual bool __thiscall QMYSQLDriver::ope
n(class QString const &,class QString const &,class QString const &,class QStrin
g const &,int,class QString const &)" (?open@QMYSQLDriver@@UAE_NABVQString@@000H
0@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_get_client_ver
sion@0 referenced in function "public: virtual bool __thiscall QMYSQLDriver::ope
n(class QString const &,class QString const &,class QString const &,class QStrin
g const &,int,class QString const &)" (?open@QMYSQLDriver@@UAE_NABVQString@@000H
0@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_set_character_
set@8 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 &)" (?open@QMYSQLDriver@@UAE_NABVQString@@000H0
@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_options@12 ref
erenced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QS
tring const &,class QString const &,class QString const &,class QString const &,
int,class QString const &)" (?open@QMYSQLDriver@@UAE_NABVQString@@000H0@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_close@4 refere
nced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QStri
ng const &,class QString const &,class QString const &,class QString const &,int
,class QString const &)" (?open@QMYSQLDriver@@UAE_NABVQString@@000H0@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_select_db@8 re
ferenced in function "public: virtual bool __thiscall QMYSQLDriver::open(class Q
String const &,class QString const &,class QString const &,class QString const &
,int,class QString const &)" (?open@QMYSQLDriver@@UAE_NABVQString@@000H0@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_real_connect@3
2 referenced in function "public: virtual bool __thiscall QMYSQLDriver::open(cla
ss QString const &,class QString const &,class QString const &,class QString con
st &,int,class QString const &)" (?open@QMYSQLDriver@@UAE_NABVQString@@000H0@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_init@4 referen
ced in function "public: virtual bool __thiscall QMYSQLDriver::open(class QStrin
g const &,class QString const &,class QString const &,class QString const &,int,
class QString const &)" (?open@QMYSQLDriver@@UAE_NABVQString@@000H0@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_thread_end@0 r
eferenced in function "public: virtual void __thiscall QMYSQLDriver::close(void)
" (?close@QMYSQLDriver@@UAEXXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_list_tables@8
referenced in function "public: virtual class QStringList __thiscall QMYSQLDrive
r::tables(enum QSql::TableType)const " (?tables@QMYSQLDriver@@UBE?AVQStringList@
@W4TableType@QSql@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_list_fields@12
referenced in function "public: virtual class QSqlRecord __thiscall QMYSQLDrive
r::record(class QString const &)const " (?record@QMYSQLDriver@@UBE?AVQSqlRecord@
@ABVQString@@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_query@8 refere
nced in function "protected: virtual bool __thiscall QMYSQLDriver::beginTransact
ion(void)" (?beginTransaction@QMYSQLDriver@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_real_escape_st
ring@16 referenced in function "public: virtual class QString __thiscall QMYSQLD
river::formatValue(class QSqlField const &,bool)const " (?formatValue@QMYSQLDriv
er@@UBE?AVQString@@ABVQSqlField@@_N@Z)
..\..\..\..\plugins\sqldrivers\qsqlmysqld.dll : fatal error LNK1120: 50 unresolv
ed externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
答案 0 :(得分:0)
下载并使用C连接器,而不是服务器安装程序附带的连接器。
http://dev.mysql.com/downloads/connector/c/
评论
#include <winsock2.h>
在mysql.h中