Why Qt Configure can not find correct MySQL installation on target when cross compiling?

964 Views Asked by At

I want to build MySQL driver while cross-compiling Qt5 for Arm(Raspberry Pi).

  • In order to check MySQL client libraries installation on target we run:
pi@raspberrypi:~ $ mysql_config --version
10.1.38
pi@raspberrypi:~ $ mysql_config --include
-I/usr/include/mysql
pi@raspberrypi:~ $ mysql_config --libs
-L/usr/lib/arm-linux-gnueabihf  -lmariadbclient -lpthread -lz -lm -ldl
  • And we configure Qt like this:
../configure -opengl es2 -device linux-rpi3-g++ -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -no-use-gold-linker -qt-xcb -xcb -sysroot $RPI_SYSROOT -opensource -confirm-license -nomake examples -nomake tests -release -make libs -prefix /usr/local/qt5pi -sql-mysql -recheck-all
  • Configure will throw error:
ERROR: Feature 'sql-mysql' was enabled, but the pre-condition 'libs.mysql' failed

Note:

  • If we look at the config.log it seems Qt Configure looks for MySQL in host machine, not sysroot or target!
[...]
looking for library mysql
Trying source 0 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 1 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 2 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 3 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 4 (type inline) of library mysql ...
None of [libmysqlclient_r.so libmysqlclient_r.a] found in [] and global paths.
=> source produced no result.
Trying source 5 (type inline) of library mysql ...
=> source failed condition 'config.win32'.
Trying source 6 (type inline) of library mysql ...
None of [libmysqlclient.so libmysqlclient.a] found in [] and global paths.
=> source produced no result.
test config.qtbase_sqldrivers.libraries.mysql FAILED
[...]

What do you suggest?

Update Sep 4'19

Seems to be a reported bug:

But still didn't get fixed!, looking for a workaround...

1

There are 1 best solutions below

2
supermilkba On

After installation, remove "config.cache" and try again.