QSQLITE driver not loaded

Hello!
We already had a rdk board by phytec with a qt application using a sqlite database (I just had to add sqlite to IMAGE_INSTALL_append), but for some reasons we switched to toradex now. As I could see, sqlite3 is already included in the console-trdx-image, so it should work out of the box (certainly, i had to add the qt libs). So this is, what my IMAGE_INSTALL_append looks like now:

IMAGE_INSTALL_append = " qtbase qtbase-plugins qtbase-fonts qtdeclarative qtdeclarative-plugins qtserialport qtwebsocket"

I also tried adding sqlite (→ the old version 2), but whenever I start our application, I always get the following error:

QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:
QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins

However, i can open the database file on the console with sqlite3 dbfile.db, so sqlite seems to be installed properly. I think Qt just cannot find the driver libary, but I don’t know how to fix this.

Systeminfo:

CoM: Toradex Colibri iMX6 Solo 256MB | V1.0A 
SBC: Viola Plus | V1.2A Plus
Image: console-trdx-image
Version: 2.6 / v2015.12 / jethro / 2.0

Hi

You are missing the Qt5 backend for sqlite.
The Qt5 Yocto recipe allows a fine grained control over enabled feature with the PACKAGECONFIG mechanism. By default a lot of those features are not enabled.

You could try to add ‘sql-sqlite’ to PACKAGECONFIG from within conf/local.conf by adding:

PACKAGECONFIG_append_pn-qtbase = " sql-sqlite"

and then rebuild the image.

Max

YOU ARE MY HERO! It worked! Thank you very much! :slight_smile:

is there any other way, without building an image??

No.

Note also our partner network, some of which offer services to build an image/SDK or application to your specification.

Hi @max.tx
I am facing the same problem. I have already added ‘sql-sqlite’ to PACKAGECONFIG from within conf/local.conf by

PACKAGECONFIG_append_pn-qtbase = " sql-sqlite" 

and also sqlite in IMAGE_INSTALL_append but still Qt is giving me following message.

QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers: 

What can be the problem.
Thank You in advance

HI @Tony_Stark

Could you provide the version of the hardware and software of your module?
Which repo branch did you use to compile?

Best regards,
Jaski

Hardware SoM: Toradex Colibri imx7 dual 1GB Colibri
Colibri Evaluation board V3.2B
Image: Angstrom-LXDE-Image
Colibri-iMX7-eMMC_LXDE-Image-Tezi_2.8b6-20191226
Version: 2.8/ v2017.12 / rocko / 2.4

Hi @Tony_Stark

Can you check and upload the following log files:
/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.8+gitAUTOINC+82eb6aa08e-r0/temp/log.do_configure
/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtbase/5.9.8+gitAUTOINC+82eb6aa08e-r0/temp/run.do_configure

Is the sqlite flag really set? Did you add sqlite or sqlite3 to your IMAGE_INSTALL? Please make sure it is sqlite3.

Regards,
Stefan

Hi stefan_e.tx Yes !!! It worked when I was following the article
“How to setup Qt Creator on Toradex” in the article you have given following syntax
+PACKAGECONFIG_append_pn-qtbase = " sql-sqlite" I just copy pasted that,And compiled the image but there were no sqlite driver library in it,But when I removed that + sign and again recompiled then the sqlite driver library is there,And my application is working good.I request you to please make the change in the article.alt text
I have attached the screenshot of the article,Please go through to it.

Hi @Tony_Stark

I see what you mean but the + is on purpose. This is how a diff file looks like:
http://fileformats.archiveteam.org/wiki/Unified_diff
I will check if we can change the syntax there.

Regards,
Stefan

I Got QSqlDatabase : QSQLITE driver not loaded using qt5.15.0 sources .

created file qtbase_%.bbappend

PACKAGECONFIG_append = " sql-sqlite"

Included above line my issue is solved.

Hi @sateesh

Thanks for your valuable Input.

Best regards,
Jaski