QMYSQL driver not loaded - cross compiling for Raspberry PI 3
-
@KroMignon When I tried to install those packages I got information that mariadb counterparts are available. So I tried to install them and it appeared that libmariadb-dev-compat,libmariadb-dev I already had, but libmariadbd-dev I didn't have so I installed it.
How can I cross-compile the plugin?
-
@JarekT said in QMYSQL driver not loaded - cross compiling for Raspberry PI 3:
How can I cross-compile the plugin?
After installing the missed packages, you have to recreate/update the sysroot.
Then restartqmake
in the sqldrivers directory (I suppose RPI sysroot is located at/home/embsys/raspi/sysroot
):/home/embsys/raspi/qtbase/bin/qmake -- MYSQL_PREFIX=/home/embsys/raspi/sysroot/usr/local make make install
-
@KroMignon said in QMYSQL driver not loaded - cross compiling for Raspberry PI 3:
Then restart qmake in the sqldrivers directory
I would suggest to do out of source builds to avoid problems with build artefacts from previous builds.
-
@KroMignon said in QMYSQL driver not loaded - cross compiling for Raspberry PI 3:
you have to recreate/update the sysroot
In the ~/raspi folder I did this (192.168.0.100 is IP of RPi):
rsync -avz pi@192.168.0.100:/lib sysroot
rsync -avz pi@192.168.0.100:/usr/include sysroot/usr
rsync -avz pi@192.168.0.100:/usr/lib sysroot/usr
rsync -avz pi@192.168.0.100:/opt/vc sysroot/optIs this what you meant by "you have to recreate/update the sysroot"?
After that I did qmake and I got the following results:
Unfortunately I don't see that MySql was configured...
Is the prefix "MYSQL_PREFIX=/home/embsys/raspi/sysroot/usr/local" correct and is it enough?
@jsulm Before I did qmake I deleted whole src folder and extracted it again. Only then I did qmake. Is this what you meant?
-
@JarekT said in QMYSQL driver not loaded - cross compiling for Raspberry PI 3:
Is the prefix "MYSQL_PREFIX=/home/embsys/raspi/sysroot/usr/local" correct and is it enough?
I don't really know, I don't have a RPI to test it.
But according to this post ==> https://raspberrypi.stackexchange.com/a/101366
You should probably use this:/home/embsys/raspi/qtbase/bin/qmake -- MYSQL_PREFIX=/home/embsys/raspi/sysroot/usr/lib/arm-linux-gnueabihf
-
@JarekT said in QMYSQL driver not loaded - cross compiling for Raspberry PI 3:
What can I do "remove any leftovers from the previous build" before I do reconfiguration?
Extract again the source code. To avoid this do out of source builds:
mkdir build cd build qmake PATH_TO_SOURCE
-
@jsulm I've extracted again the sources. But I'm not sure if I understand what you meant by: "To avoid this do out of source builds". Do you mean that after I have newly extracted source code, I should always do the qmake in a new folder (eg. "build" as you mentioned) so that I do not affect the source code and in this way I can always do fresh compilation without the need to extract the source code files again?
Assuming that this is what you meant I did this:
As I can see mysql was not compiled... Could you please check if the paths and prefixes are correct?...
-
@JarekT said in QMYSQL driver not loaded - cross compiling for Raspberry PI 3:
I should always do the qmake in a new folder
Yes.
To check why it still does not work please see what is in configure.log file.
-
@JarekT said in QMYSQL driver not loaded - cross compiling for Raspberry PI 3:
Could you please help me understand those problems?
Can you says which is the local path where you have put the sysroot? I supposed it was /home/embsys/raspi/sysroot.
Then search in this path where is located libmysqlclient withfind
:find /home/embsys/raspi/sysroot -name libmysqlclient*.*
Then use the path to configure/compile your plugin:
/home/embsys/raspi/qtbase/bin/qmake -- MYSQL_PREFIX=<lib_mysqlclient_path>
-
@KroMignon said in QMYSQL driver not loaded - cross compiling for Raspberry PI 3:
Can you says which is the local path where you have put the sysroot? I supposed it was /home/embsys/raspi/sysroot.
Yes, this is my sysroot. I did it as you can see below
This command I tried also before and the results are unsuccessful as before..
Here I'm configuring/compiling the plugin using sqldriver.pro file, but I also read somewhere that mysql.pro (/home/embsys/raspi/qt-everywhere-src-5.12.3/qtbase/src/plugins/sqldrivers/mysql/mysql.pro) file should compiled. Do you know anything about it? -
Another idea: shouldn't I configure qmake itself before I try to use it to compile the plugin?
That was my configure command when I was doing cross-compiling configuration (as in the LINK)
./configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v -no-gbm
The above doesn't include mysql feature (should it??)
-
@JarekT said in QMYSQL driver not loaded - cross compiling for Raspberry PI 3:
shouldn't I configure qmake itself
What do you want to configure?
-
@jsulm Sorry if the way I explained it was not correct. I meant that when I was preparing the framework for cross-compilation in the folder /home/embsys/raspi/qtbase I did
./configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v -no-gbm
Should it contain something about mysql?
-
@JarekT said in QMYSQL driver not loaded - cross compiling for Raspberry PI 3:
Should it contain something about mysql?
It should be possible to build MySQL related stuff after compiling Qt.
Did you search for libmysqlclient* as @KroMignon suggested to make sure you pass correct paths?
Also, please post text instead of screen-shots.
-
@jsulm said in QMYSQL driver not loaded - cross compiling for Raspberry PI 3:
Did you search for libmysqlclient* as @KroMignon suggested to make sure you pass correct paths?
Yes, the paths for libmysqlclient.. is correct.
embsys@JT-UBUNTU:~/qmakeBuild$ find /home/embsys/raspi/sysroot -name libmysqlclient*.* /home/embsys/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libmysqlclient.a /home/embsys/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libmysqlclient_r.so /home/embsys/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libmysqlclient.so /home/embsys/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libmysqlclient_r.a
Ok, I will try to post text instead of screen-shots.
-
I'm constantly trying to solve the issue... any help would be much appreciated..
I have noticed that when I choose different qmake, MySQL plugin is configured and prepared for building. Please have a look:
embsys@JT-UBUNTU:~/raspi/test$ /home/embsys/Qt5.14.2/5.14.2/gcc_64/bin/qmake /home/embsys/raspi/qt-everywhere-src-5.12.3/qtbase/src/plugins/sqldrivers/sqldrivers.pro -- MYSQL_PREFIX=/home/embsys/raspi/sysroot/usr/lib/arm-linux-gnueabihf Running configuration tests... Checking for DB2 (IBM)... no Checking for InterBase... no Checking for MySQL... yes Checking for OCI (Oracle)... no Checking for ODBC... no Checking for PostgreSQL... yes Checking for SQLite (version 2)... no Checking for TDS (Sybase)... no Done running configuration tests. Configure summary: Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. yes OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. yes SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no Qt is now configured for building. Just run 'make'. Once everything is built, you must run 'make install'. Qt will be installed into '/home/embsys/Qt5.14.2/5.14.2/gcc_64'. Prior to reconfiguration, make sure you remove any leftovers from the previous build.
Unfortunately when I try to use the qmake for cross-compiler path I get the following:
embsys@JT-UBUNTU:~/raspi/test$ /home/embsys/raspi/qtbase/qmake/qmake /home/embsys/raspi/qt-everywhere-src-5.12.3/qtbase/src/plugins/sqldrivers/sqldrivers.pro -- MYSQL_PREFIX=/home/embsys/raspi/sysroot/usr/lib/arm-linux-gnueabihf Running configuration tests... Checking for DB2 (IBM)... no Checking for InterBase... no Checking for MySQL... no Checking for OCI (Oracle)... no Checking for ODBC... yes Checking for PostgreSQL... yes Checking for SQLite (version 2)... yes Checking for TDS (Sybase)... yes Done running configuration tests. Configure summary: Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... yes PostgreSQL ............................. yes SQLite2 ................................ yes SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... yes Qt is now configured for building. Just run 'make'. Once everything is built, you must run 'make install'. Qt will be installed into '/home/embsys/raspi/qt5pi'. Prior to reconfiguration, make sure you remove any leftovers from the previous build.
I lack good knowledge about qmake tool, but maybe there is something wrong with the qmake I try to use for Raspberry PI.
BTW I have different qmakes in my host:embsys@JT-UBUNTU:~/raspi$ sudo find / -name qmake -type f /home/embsys/ti-processor-sdk-linux-rt-am335x-evm-05.03.00.07/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/qt5/qmake /home/embsys/ti-processor-sdk-linux-rt-am335x-evm-05.02.00.10/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/qt5/qmake /home/embsys/ti-processor-sdk-linux-am335x-evm-05.02.00.10/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/qt5/qmake /home/embsys/Qt5.14.2/qt-everywhere-src-5.14.2/qtbase/bin/qmake /home/embsys/Qt5.14.2/5.14.2/gcc_64/bin/qmake /home/embsys/raspi/qt5/bin/qmake /home/embsys/raspi/qtbase/bin/qmake /home/embsys/raspi/qtbase/qmake/qmake find: ‘/run/user/1000/doc’: Permission denied find: ‘/run/user/1000/gvfs’: Permission denied /usr/lib/x86_64-linux-gnu/qt4/bin/qmake /usr/lib/qt5/bin/qmake
Could sb explain what is the difference between those qmakes that are in RPi paths? namely:
/home/embsys/raspi/qt5/bin/qmake /home/embsys/raspi/qtbase/bin/qmake /home/embsys/raspi/qtbase/qmake/qmake
I tried all of them but they give the same results.
Is it possible that I somehow have a problem with Qt instalation for cross-compiling (and consequently with qmake) and this is the problem?