Unsolved building mysql plugin for qt (c++)
-
Hello helpers,
i have been searching on web for two weeks
i am trying to build mysql plugin for qt using mingw32 and mysql server 8 and already was trying with my sql server 5.5 32 bit
qmake "INCLUDEPATH+=C:/dev/mysql-dev/include” “LIBS+=-LC:/dev/mysql-dev/lib -libmysql” mysql.pro mingw32-make
but it's printing this error : project error: mysql library was not defined
please help me
Qt newbie
thanks in advance -
Hi and welcome to devnet,
This question has been already asked a lot of time on this very forum.
The informations requested is always the same:
- what version of Qt are you using ?
Looking at the line you are using you don't seem to follow Qt's documentation to build the MySQL driver, are you ?
-
@SGaist
i installed QT 5.12.6 but in start menu it shows QT 4.11 community
mingw32- version is 5.12.6
i am confused
i followed the instruction as documentation says but no result
thanks for replying -
@silvio_2020 said in building mysql plugin for qt (c++):
followed the instruction as documentation says but no result
And how should we help here? What is 'no result'? What exactly did you do and what did not work??
-
@Christian-Ehrlicher
qmake "INCLUDEPATH+=C:/dev/mysql-dev/include” “LIBS+=-LC:/dev/mysql-dev/lib -libmysql” mysql.pro mingw32-make
but it's printing this error : project error: mysql library was not defined
what is wrong ? -
@silvio_2020 said in building mysql plugin for qt (c++):
what is wrong ?
You did not follow the instructions
-
@Christian-Ehrlicher
yes
i downloaded Qt src , Mysql server 8
joined the libmysql.lib to mysql.pro while building
and that's all
but honestly Qt documentation seems unclear for some one newbie
i tried all my possible
can you provide more clear path ? -
You have the exact line to use in the documentation linked by @Christian-Ehrlicher which does not match what you are currently using.
-
@SGaist
i used that line of code described in the documentation but it's shows the same result
there is any requirement of compatibility between mysql server version (64) and qt
in config test it shows
sqlite yes
mysql no -
What exact error are you getting in the logs ?
-
@SGaist said in building mysql plugin for qt (c++):
What exact error are you getting in the logs ?
And what was your command line? Did you remove config.cache in the directory before?
-
@SGaist
i do it again with the line code described in Qt doc
and now it tells me that
qmake -- MYSQL_INCDIR=C:\dev\mysql-dev\include "MYSQL_LIBDIR=C:/dev/mysql-dev/lib/lib/libmysql.lib" mingw32-make sub-mysql"no rule to make target "mingw32-make" "
-
These are two commands ...
what did
"qmake -- MYSQL_INCDIR=C:\dev\mysql-dev\include "MYSQL_LIBDIR=C:/dev/mysql-dev/lib/lib/libmysql.lib"" print?mingw32-make is in your PATH when you opened the correct Qt command prompt.
-
@Christian-Ehrlicher said in building mysql plugin for qt (c++):
These are two commands ...
what did
"qmake -- MYSQL_INCDIR=C:\dev\mysql-dev\include "MYSQL_LIBDIR=C:/dev/mysql-dev/lib/lib/libmysql.lib"" print?mingw32-make is in your PATH when you opened the correct Qt command prompt.
i opened CMD in this directory after updating envirennement variable
C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers\mysql -
@silvio_2020 said in building mysql plugin for qt (c++):
i opened CMD in this directory after updating envirennement variable
This is wrong, you have to open your Qt command line where your compiler is correctly set up.
C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers\mysql
And this is also the wrong directory according to the documentation.
-
@Christian-Ehrlicher said in building mysql plugin for qt (c++):
@silvio_2020 said in building mysql plugin for qt (c++):
i opened CMD in this directory after updating envirennement variable
This is wrong, you have to open your Qt command line where your compiler is correctly set up.
C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers\mysql
And this is also the wrong directory according to the documentation.
i tried with the right path (sqldrivers)
and you can see what is the result
qmake -- MYSQL_INCDIR=C:\dev\mysql-dev\include "MYSQL_LIBDIR=C:/dev/mysql-dev/lib/opt" mingw32-make sub-mysql
"error: invalid command line parameter 'mingw32-make'" -
As @Christian-Ehrlicher already pointed out, your are writing two different commands as one hence the error you are getting.
Keep them properly separated as in the documentation and @Christian-Ehrlicher's post.
-
@silvio_2020 said in building mysql plugin for qt (c++):
"error: invalid command line parameter 'mingw32-make'"
Again: This is not in the docs! These are two commands:
"qmake -- MYSQL_INCDIR=C:\dev\mysql-dev\include "MYSQL_LIBDIR=C:/dev/mysql-dev/lib/opt""
and
"mingw32-make sub-mysql"Is it so hard to follow the instructions?
/edit: here is a slightly updated document: https://doc-snapshots.qt.io/qt5-5.14/sql-driver.html#how-to-build-the-qmysql-plugin-on-windows
-
This post is deleted! -
@Christian-Ehrlicher said in building mysql plugin for qt (c++):
@SGaist said in building mysql plugin for qt (c++):
What exact error are you getting in the logs ?
And what was your command line? Did you remove config.cache in the directory before?
what means removing config.cach ?
the same issue , when i launch the command as described it shows me
mysql..... no
what scenaro i am missing ?