5

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...

IMAN4K
  • 1,265
  • 3
  • 24
  • 42

1 Answers1

-1

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

Jeff Schaller
  • 2,352
  • 5
  • 23
  • 38
  • supermilkba, this does not provide an answer to the question. Once you have sufficient [reputation](/help/whats-reputation) you will be able to [comment on any post](/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](//meta.stackexchange.com/q/214173). – Yunnosch Apr 14 '23 at 06:13
  • Or maybe phrase this as an explained conditional answer, in order to avoid the impression of asking a clarification question instead of answering (for which a comment should be used instead of an answer, compare https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead ). For example like "If your problem is ... then the solution is to .... because .... ." – Yunnosch Apr 14 '23 at 06:13