I tried a lot of things I read on documentations or tutorials... But I still can't cross-compile Qt with the MySQL library driver. Story begins:
I have to cross-compile Qt from Linux to Windows (32bits) using MinGW (i686-w64-mingw32-
prefix to be precise). I downloaded qtbase-opensource-src-5.9.4
and started to work like that:
$ ./configure -prefix [...]/qt-5.9.4 -xplatform win32-g++ -device-option CROSS_COMPILE=/usr/bin/i686-w64-mingw32- -opengl desktop -no-sql-odbc -sql-sqlite -enable-shared -nomake examples -nomake tests -release
And it worked. Then, make
and make install
worked too. But I figured out that there was only the SQLite ".dll" in the plugins/sqldrivers
repository. So I tried to compile the MySQL driver and... How can I do that?? If I add -sql-mysql
to my ./configure ...
call, I have to following error:
ERROR: Feature 'sql-mysql' was enabled, but the pre-condition 'libs.mysql' failed.
I downloaded MySQL library from the official website to get mysql-5.7.21-win32.zip
. But how to link it with qtbase sources? Adding MYSQL_INCDIR=[...]/mysql-5.7.21-win32/include
and MYSQL_LIBDIR=[...]/mysql-5.7.21-win32/lib
or just MYSQL_PREFIX=[...]/mysql-5.7.21-win32
to my ./configure ...
command results to the same error message.
Any idea please?
EDIT:
I tried to compile the driver like that (with the qmake
I built previously):
$ cd qtbase-opensource-src-5.9.4/src/plugins/sqldrivers/mysql
$ [/*prefix of my previous build*/]/qt-5.9.4/bin/qmake .
And the result is:
Project ERROR: Library 'mysql' is not defined.