为什么Qt Configure在交叉编译时无法在目标上找到正确的MySQL安装?

IMA*_*N4K 5 qt libmysql qtsql qt5 raspberry-pi

我想建立MySQL驾驶员在交叉编译Qt5Arm(Raspberry Pi)

  • 为了检查MySQL目标上的客户端库安装,我们运行:
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
Run Code Online (Sandbox Code Playgroud)
  • 我们这样配置Qt
../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
Run Code Online (Sandbox Code Playgroud)
  • 配置将抛出错误:
ERROR: Feature 'sql-mysql' was enabled, but the pre-condition 'libs.mysql' failed
Run Code Online (Sandbox Code Playgroud)

注意:

  • 如果我们看一下,config.log似乎Qt Configure会在主机而不是sysroot或target中寻找MySQL!
[...]
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
[...]
Run Code Online (Sandbox Code Playgroud)

你有什么建议?

更新19年4月4日

似乎是一个已报告的错误:

但仍然没有解决!,正在寻找解决方法...

小智 -1

安装后,删除“config.cache”并重试。