Unsolved Cross-compile MySQL driver for RPi3
-
Yes, I run it from Qt to the remote RPi3. The application runs flawless if I use the Desktop kit. When I use the kit I've made for the Raspberry pi 3 (that has always worked fine) I get that error
-
@endr Does this file exist on your target device: libmysqlclient.so.18 ? If so where?
-
If I copy :
libmysqlclient.a libmysqlclient_r.a libmysqlclient_r.so libmysqlclient_r.so.18 ibmysqlclient_r.so.18.0.0 libmysqlclient.so libmysqlclient.so.18 libmysqlclient.so.18.0.0
to /usr/lib on my target device I get:
QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers:
otherwise, without copying the shared libraries on the remote device (trying to crosscompile them from the local machine) I keep getting:
/opt/MySqlTest/bin/MySqlTest: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory Application finished with exit code 127.
What can I do?
-
@endr You can try to start your app like this:
QT_DEBUG_PLUGINS=1 && ./my_app
You will get a lot of output, post it here.
The libraries you're copying: are those for your target (ARM)?
-
@jsulm
I connect in ssh to the RPi3, start the application as you suggested:root@rpi3:/opt/MySqlTest/bin# QT_DEBUG_PLUGINS=1 && ./MySqlTest ./MySqlTest: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
If I copy those shared libraries (from the libmysqlclient-dev package downloaded on a Raspbian OS) to /usr/lib I get this:
root@rpi3:/opt/MySqlTest/bin# QT_DEBUG_PLUGINS=1 && ./MySqlTest Unable to query physical screen size, defaulting to 100 dpi. To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters). QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers:
-
-
There is no sqldrivers directory in qt5/plugins, just those:
root@rpi3:/usr/lib/qt5/plugins# ls -l total 68 drwxr-xr-x 2 root root 4096 Jun 14 10:51 bearer drwxr-xr-x 2 root root 4096 Jun 14 11:44 canbus drwxr-xr-x 2 root root 4096 Jun 14 10:51 egldeviceintegrations drwxr-xr-x 2 root root 4096 Jun 14 10:51 generic drwxr-xr-x 2 root root 4096 Jun 14 12:23 geoservices drwxr-xr-x 2 root root 4096 Jun 14 11:43 iconengines drwxr-xr-x 2 root root 4096 Jun 14 12:33 imageformats drwxr-xr-x 2 root root 4096 Jun 14 12:24 lipi_toolkit drwxr-xr-x 2 root root 4096 Jun 14 12:08 mediaservice
What do I need to download?
-
@endr How did you install Qt on RaspberryPi?
-
I'm using Yocto, Qt5 is installed via the meta-qt5 layer during the bitbaking of the image
-
@endr Well, then I don't know what exactly you need to install. Something with qt and mysql. On Ubuntu it is libqt5sql5-mysql package.