Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QSQLITE driver not loaded



  • Hello,

    I have a strange problem. I've been using SQLite with my program for a while now, and it has worked okay. Because of a bug in QSQLTableModel, I had to update my Qt version from 5.0.1 to 5.1.1. Everything worked fine for couple of days.

    Today I realized, that my project is again using the 5.0.1 version of Qt! Appearantly installing new version of Qt, it also creates a new Qt Creator -exe, and therefore I've started the old one without noticing it. Well, all is fine I remove the 5.0.1 folder from C:\Qt, restart Qt Creator and try to run my application. I now get the error:

    QSQLITE driver not loaded

    If I move the 5.0.1 folder back to C:\Qt, it works again! I've checked, that there are same files in C:\Qt\Qt5.1.1\5.1.1\mingw48_32\plugins\sqldrivers that there are in 5.0.1 folder. So why does it check files from the 5.0.1 folder??


  • Moderators

    check the QtCreator settings, especially the configuration of your kits.
    Also you may check the QTDIR environment variable.



  • [quote author="raven-worx" date="1381300269"]check the QtCreator settings, especially the configuration of your kits.
    Also you may check the QTDIR environment variable.[/quote]

    Thanks for your answer.

    I checked my PATH -variable on my computer, it still had the path for 5.0.1 -directory. I now changed that to 5.1.1, restarted Qt Creator and tried to run my app. Still I get the following error:

    QSqlDatabase: QSQLITE driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3

    Seems like it does find the driver.. But can't load for some reason.. Any suggestions? :(

    EDIT: I got it working now, by rebuilding the QSQLITE driver with 5.1.1 version of Qt. I guess there was something wrong with the driver I've used earlier or something, don't know!


  • Lifetime Qt Champion

    Hi,

    Since the path were wrong, you might have been trying to load the sqlite plugin from 5.0.1 while using the 5.1.1 libraries


Log in to reply