Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Error QSQLITE driver not loaded, but the driver is there and it's called after QApplication!
Forum Updated to NodeBB v4.3 + New Features

Error QSQLITE driver not loaded, but the driver is there and it's called after QApplication!

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 14.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    danielfranca
    wrote on last edited by
    #1

    First I've to say that it was working after some problems I got with Qt versions and then I had to compile Qt4.8 from sources.

    Now when I ran my application I get this error:
    QSqlDatabase: QSQLITE driver not loaded
    QSqlDatabase: available drivers:

    but the sqlite driver is there: /usr/local/Trolltech/Qt-4.8.0/plugins/sqldrivers/
    libqsqlite.dylib libqsqlite_debug.dylib

    Then I put this line of code:
    QApplication::addLibraryPath( "/usr/local/Trolltech/Qt-4.8.0/plugins/" );

    And it's working... but I want to know a better way to solve this problem, and I don't think my solution will gonna work in others computers.

    I'm running on a OSX 10.6
    GCC 4.2
    Qt 4.8 compiled with dbus disabled and as framework.

    PS: The call to SQLITE is after QApplication constructor

    1 Reply Last reply
    0
    • L Offline
      L Offline
      luisvaldes88
      wrote on last edited by
      #2

      Hi..

      I think that by default qt application try to load the plugins in the same path of your executable.
      You can try it by creating this structure in the same directory of your app.

      • plugins / sqldrivers
        and put your available drivers there. (libqsqlite.dylib libqsqlite_debug.dylib)

      QT_PLUGIN_PATH, that in your system is /usr/local/Trolltech/Qt-4.8.0/plugins/.

      you should read "this":http://developer.qt.nokia.com/doc/qt-4.8/qt-conf.html

      Muchos quieren, pocos pueden, algunos consiguen.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        miroslav
        wrote on last edited by
        #3

        If the program is executed from within your enveloper build, it should find the plugins in Qt. If you want to run it on a user computer, you need to run macdeployqt on it. It will add the necessary Qt plugins to the bundle.

        Check out http://developer.qt.nokia.com/doc/qt-4.8/deployment-mac.html for more details.

        Mirko Boehm | mirko@kde.org | KDE e.V.
        FSFE Fellow
        Qt Certified Specialist

        1 Reply Last reply
        0
        • D Offline
          D Offline
          danielfranca
          wrote on last edited by
          #4

          I'm running under Qt Creator...
          I've created a variable QT_PLUGIN_PATH and it works... but I guess it's not the real problem, right? Because it should find my plugins at first, right?

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved