3
Все кажется, что все идет нормально, пока nmake не попытается связаться с библиотекой mysql.Невозможно скомпилировать плагин QT MYSQL для Windows
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
-------------------------------------- СНИП ---- ---------------------------------------
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
----- ---------------------------------- СНИП --------------- ----------------------------
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 [email protected]
referenced in function "public: bool __thiscall QMYSQLResultPrivate::bindInValue
s(void)" ([email protected]@@QAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] r
eferenced in function "public: bool __thiscall QMYSQLResultPrivate::bindInValues
(void)" ([email protected]@@QAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_result_me
[email protected] referenced in function "public: bool __thiscall QMYSQLResultPrivate::bi
ndInValues(void)" ([email protected]@@QAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] r
eferenced 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] re
ferenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch(int
)" ([email protected]@@[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] r
eferenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch(in
t)" ([email protected]@@[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] r
eferenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch(in
t)" ([email protected]@@[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_data_seek
@12 referenced in function "protected: virtual bool __thiscall QMYSQLResult::fet
ch(int)" ([email protected]@@[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] r
eferenced in function "class QSqlError __cdecl qMakeStmtError(class QString cons
t &,enum QSqlError::ErrorType,struct st_mysql_stmt *)" ([email protected]@YA?AVQS
[email protected]@[email protected]@[email protected]@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] r
eferenced in function "class QSqlError __cdecl qMakeStmtError(class QString cons
t &,enum QSqlError::ErrorType,struct st_mysql_stmt *)" ([email protected]@YA?AVQS
[email protected]@[email protected]@[email protected]@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] ref
erenced in function "protected: virtual bool __thiscall QMYSQLResult::fetchLast(
void)" ([email protected]@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected]
4 referenced in function "protected: virtual bool __thiscall QMYSQLResult::fetch
Last(void)" ([email protected]@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected]
4 referenced in function "protected: virtual class QVariant __thiscall QMYSQLRes
ult::data(int)" ([email protected]@@[email protected]@[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_fetch_field_di
[email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::
reset(class QString const &)" ([email protected]@@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected]
4 referenced in function "protected: virtual bool __thiscall QMYSQLResult::reset
(class QString const &)" ([email protected]@@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "protected: virtual bool __thiscall QMYSQLResult::reset(c
lass QString const &)" ([email protected]@@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected]
referenced in function "protected: virtual bool __thiscall QMYSQLResult::reset(c
lass QString const &)" ([email protected]@@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] refere
nced in function "class QSqlError __cdecl qMakeError(class QString const &,enum
QSqlError::ErrorType,class QMYSQLDriverPrivate const *)" ([email protected]@YA?AVQSql
[email protected]@[email protected]@[email protected]@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] refere
nced in function "class QSqlError __cdecl qMakeError(class QString const &,enum
QSqlError::ErrorType,class QMYSQLDriverPrivate const *)" ([email protected]@YA?AVQSql
[email protected]@[email protected]@[email protected]@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] re
ferenced in function "protected: virtual class QVariant __thiscall QMYSQLResult:
:lastInsertId(void)const " ([email protected][email protected]@[email protected]@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 " ([email protected]@@[email protected]@XZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] r
eferenced in function "protected: virtual class QSqlRecord __thiscall QMYSQLResu
lt::record(void)const " ([email protected]@@[email protected]@XZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_param_cou
[email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::pr
epare(class QString const &)" ([email protected]@@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected]
2 referenced in function "protected: virtual bool __thiscall QMYSQLResult::prepa
re(class QString const &)" ([email protected]@@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] re
ferenced in function "protected: virtual bool __thiscall QMYSQLResult::prepare(c
lass QString const &)" ([email protected]@@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_store_res
[email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::e
xec(void)" ([email protected]@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected]
12 referenced in function "protected: virtual bool __thiscall QMYSQLResult::exec
(void)" ([email protected]@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_bind_resu
[email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::ex
ec(void)" ([email protected]@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_affected_
[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(v
oid)" ([email protected]@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_stmt_bind_para
[email protected] referenced in function "protected: virtual bool __thiscall QMYSQLResult::exe
c(void)" ([email protected]@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] r
eferenced in function "protected: virtual bool __thiscall QMYSQLResult::exec(voi
d)" ([email protected]@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_character_set_
[email protected] referenced in function "class QTextCodec * __cdecl codec(struct st_mysql
*)" ([email protected]@[email protected]@[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 &,class QString const &,class QString const
&,int,class QString const &)" ([email protected]@@[email protected]@[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_get_server_ver
[email protected] 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 &)" ([email protected]@@[email protected]@000H
[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_get_client_ver
[email protected] 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 &)" ([email protected]@@[email protected]@000H
[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_set_character_
[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]@000H0
@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] 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 &)" ([email protected]@@[email protected]@[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] 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 &)" ([email protected]@@[email protected]@[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] 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 &)" ([email protected]@@[email protected]@[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected]
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 &)" ([email protected]@@[email protected]@[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] 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 &)" ([email protected]@@[email protected]@[email protected])
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] r
eferenced 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 QMYSQLDrive
r::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 QMYSQLDrive
r::record(class QString const &)const " ([email protected]@@[email protected]
@[email protected]@@Z)
qsql_mysql.obj : error LNK2019: unresolved external symbol [email protected] refere
nced in function "protected: virtual bool __thiscall QMYSQLDriver::beginTransact
ion(void)" ([email protected]@@MAE_NXZ)
qsql_mysql.obj : error LNK2019: unresolved external symbol _mysql_real_escape_st
[email protected] referenced in function "public: virtual class QString __thiscall QMYSQLD
river::formatValue(class QSqlField const &,bool)const " ([email protected]
[email protected]@[email protected]@[email protected]@[email protected])
..\..\..\..\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.
Вы подразумеваете закомментировать включают? Компилятор сказал мне, что некоторые файлы сокетов неоднократно были определены, поэтому я удалил это. Но в любом случае, это все еще не работает. Я заметил, что компоновщик ищет функции mysql с добавлением @ 4 к имени. Есть ли флаг C vs C++ где-нибудь или мне нужно просто обернуть mysql.h в extern «C»? –
HahaHortness
Не, но , он был скрыт, потому что я забыл поместить его в блок кода. –
Chang