Unsolved building mysql plugin for qt (c++)
-
@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 ? -
@silvio_2020 said in building mysql plugin for qt (c++):
what means removing config.cach ?
a config.cache file is created which should be removed when you try again, otherwise the search for the mysql lib will not be performed again.
what scenaro i am missing ?
You neither posted the qmake command line you're really using nor where you installed the MySQL server to / where the files mentioned in my (second) link (mysql.h, ...) are.
-
@Christian-Ehrlicher said in building mysql plugin for qt (c++):
@silvio_2020 said in building mysql plugin for qt (c++):
what means removing config.cach ?
a config.cache file is created which should be removed when you try again, otherwise the search for the mysql lib will not be performed again.
what scenaro i am missing ?
You neither posted the qmake command line you're really using nor where you installed the MySQL server to / where the files mentioned in my (second) link (mysql.h, ...) are.
this is the qmake commande line i am actually using:
qmake MYSQL_INCDIR="C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" MYSQL_LIBDIR="C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib"
must i indicate the Qmake version in the commande line for building the plugin ?
i installed the c connector c 6.1.11 in C:/Program Files (x86)/MySQL/ -
@silvio_2020
Finally
mysql .......... yes
i did not deleted the config.cach
i have been deleting config.log all the time
as recap
i installed mysql c connector 6.1.11 in program files/mysql
qt already installed
i am working with mingw 64 bit
qmake command line ?
i used as described in the qt doc cute doc
lesson learned
every time you give it a new building try you must delete the config.cach
thanks for everything -
Thanks you man, you saved my life.
-
@SGaist said in building mysql plugin for qt (c++):
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.
after building the plugin
and i copied both files to project path it still printing :
`C:\Qt\5.12.6\mingw73_32\bin\libmysql.dll': Shared library architecture i386 is not compatible with target architecture i386:x86-64.
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
what i'am missing ?