[SOLVED]mysql.pro build errors
-
I'm sorry. My bad. I've forgotten that I have 5.1.1. Later I've got hold of 5.1.1 src and used them. mysql.pro:
@TARGET = qsqlmysqlSOURCES = main.cpp
OTHER_FILES += mysql.json
include(../../../sql/drivers/mysql/qsql_mysql.pri)PLUGIN_CLASS_NAME = QMYSQLDriverPlugin
include(../qsqldriverbase.pri)
INCLUDEPATH += C:\MySQL_lib\include
LIBS += C:\MySQL_lib\lib\libmysql.lib
@
Didn't edit anything else at all. Then, trying to rebuild, I get errors as follows:
c:/qt/tools/mingw48_32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -llibmysql
collect2.exe: error: ld returned 1 exit status
Thus, the lib cannot be found. And if I add not new paths, but default, how they were with the MySQL server from the start I get the same error. -
P.S. I've always had problems with linking with libs etc.)
-
Please use forward slashes for paths.
Also try replacing your LIBS line with
@LIBS += -LC:/MySQL_lib/lib@
-
Hi! Now it doesn't say it can't find a lib, but it obviously doesn't find it anyway. there are no "can't find" errors, but there are 107 "undefined reference to..." errors, all of them about some mysql functions. And all of them in qsql_mysql.cpp file(
-
What does "C:\MySQL_lib\lib" contain ?
-
I have removed and downloaded the most fresh MySQL. So now libs are located this way: C:\MySQL\MySQL_Server_5.5\lib and the mysql.pro looks like this:
@TARGET = qsqlmysqlSOURCES = main.cpp
OTHER_FILES += mysql.json
include(../../../sql/drivers/mysql/qsql_mysql.pri)PLUGIN_CLASS_NAME = QMYSQLDriverPlugin
include(../qsqldriverbase.pri)LIBS += -LC:/MySQL/MySQL_Server_5.5/lib
INCLUDEPATH += C:/MySQL/MySQL_Server_5.5/include
@
Errors are absolutely the same. "C:/MySQL/MySQL_Server_5.5/lib" directory contains:
debug (folder)
plugin (folder)
libmysql.dll
libmysql.lib
mysqlclient.lib -
May it be, that libmysql I have downloaded is, say, x64 or something of the sort, so that compiler just is not compatible with it?
-
Hi, yes - if you try to use the 64-bit MYSQL with the mingw 32-Bit you won't succeed
-
The thing is, that I don't really know how to find out)
-
I suggest you have a look at this short step-by-step tutorial:
"Qt5 MYSQL":http://seppemagiels.com/blog/create-mysql-driver-qt5-windows -
Yes, thanks, I'm already reading and downloading mysql-5.6.16-win32.zip
-
Great thanks to everybody and especially to Samuel! Everything works!)
-
Hi, that's fine - good news!
Please mark your thread as [SOLVED] by editing the first post -
What have you change, that you get rid off this error?