Solved How to add QMySQL driver for Raspberry Pi?
-
Seems like you didn't install the MySQL client libraries on your RPi3.
If you can't find the mysql.pro file it's likely that you didn't download Qt's sources.
-
I installed MySQL client libraried on my RPI3. libmysqlclient.so file could be found.
And I didn't download Qt sources like you said.
Because I thought that the MySQL driver for RPI would be made by cross-compilation.
(MySQL driver for RPI is built on linux machine and is transferd into RPI.)
Should I have both Qt source and MySQL client libraries in RPI3 and follow above instructions for building driver? -
My bad, I forgot you cross-compiled so you already should have the sources for that.
If the MySQL dev package wasn't installed when cross-compiling Qt, then the driver won't be built. You can however follow the documentation by using the qmake from your cross-compiled Qt and the path to the sysroot where the libraries/headers can be found.
-
I solved the problem. Thank you very much!!! :D
-
You're welcome !
What was the problem in the end ?
-
I did 'qmake' that was created by cross-compilation as your guide.
After that, compiled MySQL driver was copied into mounted RPI image.
My mistake is that I understood instruction is need to be done on RPI. -
Cross-compilation is a tricky subject.
Happy coding ! :)
-
Hi!
So I followed the instructions here to cross-build a MySql driver. I have the same environment as you but I get this error:
Project ERROR: Library 'mysql' is not defined.I am using Ubuntu Mate on my Raspberry Pi 3.
mysql_config --include says -I/usr/include/mysql
mysql_config --libs says -L/usr/lib/arm-linux-gnueabihf -lmysqlclient -lpthread -lz -lm -lrt -ldlSo the line to compile I am using is:
${CROSS_BUILT_QMAKE}/./qmake "INCLUDEPATH+=${SYSROOT}/usr/include/mysql" "LIBS+=-L${SYSROOT}/usr/lib/arm-linux-gnueabihf -lmysqlclient_r" mysql.proAny help would be appretiated.
Thank you!
-
@SGaist
Hello, I am new in Qt programming, I have the same situation as sir @andquesada . When i want to qmake the sql driver, the output is : Project ERROR: Library 'mysql' is not defined.Hope that you can help us. Thx
-
Which version of Qt are you trying to build ?