Mysql Plugin Strange Error
-
While trying to install MySql v5.5 with QtSdk 4.8.1 I have tried many of the postings and instructions.
I get through the reimp and the dlltool steps, change directories, and run:
@
qmake -o Makefile "INCLUDEPATH+=C:/MySQL5/MySQLS~1.5/include" "LIBS+=C:/MySQL5/MySQLS~1.5/lib/opt/liblibmysql.a" mysql.pro
@
then:mingw32-make
The first few steps procede normally and the I get the following messages (starting from the g++ command):
@
g++ -mthreads -shared -Wl,--out-implib,debug\libqsqlmysqld4.a -o debug\qsqlmysqld4.dll debug/main.o debug/qsql_mysql.o d
ebug/moc_qsql_mysql.o -L"c:\QtSDK\Desktop\Qt\4.8.1\mingw\lib" debug\qsqlmysqld_resource_res.o C:/MySQL5/MySQLS~1.5/lib/
opt/liblibmysql.a -lQtSqld4 -lQtCored4Creating library file: debug\libqsqlmysqld4.a
debug/qsql_mysql.o: In function
codec': C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql/../../../sql/drivers/mysql/qsql_mysql.cpp:223: undefined reference to
mysql_character_set_name@4'debug/qsql_mysql.o: In function
qMakeError': C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql/../../../sql/drivers/mysql/qsql_mysql.cpp:234: undefined reference to
mysql_error@4'C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql/../../../sql/drivers/mysql/qsql_mysql.cpp:237: undefined reference
to `mysql_errno@4'debug/qsql_mysql.o: In function
qMakeStmtError': C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql/../../../sql/drivers/mysql/qsql_mysql.cpp:309: undefined reference to
mysql_stmt_error@4'C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql/../../../sql/drivers/mysql/qsql_mysql.cpp:312: undefined reference
to `mysql_stmt_errno@4'debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:358:
undefined reference to `mysql_stmt_result_metadata@4'debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:362:
undefined reference to `mysql_num_fields@4'debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:369:
undefined reference to `mysql_fetch_field@4'debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:432:
undefined reference to `mysql_free_result@4'
@
It continues through the entire qsql_mysql.cpp file. I'm guessing the @ is caused by unicode but I'm not sure.I tried using Microsofts nmake and got the same error. I've tried using the liblibmysql.a library and the libmysql.lib all get the same results.
Any suggestions (careful...)
-
If you use on windows OS,first you can install mysql5.5 and try to copy the mysql dll files from qtsdk into plugins directory.
suppose you can use linux, please do it on static compilation.
Plz try below link.http://qt-project.org/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc