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. [SOLVED] How to install an application using SQlite under Windows?

[SOLVED] How to install an application using SQlite under Windows?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 7.6k Views
  • 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.
  • J Offline
    J Offline
    joergpauly
    wrote on last edited by
    #1

    Hello, Everyone,

    I've written an application that is using QNetwork and QSql, especially the SQlite plugin.

    To build the Windows installer I use ClickTeam's Installer Creator. Works fine...!
    I put the following files into the Setup:

    the application's .exe
    the application's icon file
    libgcc_s_dw_2-1.dll
    mingwm10.dll
    QtCore4.dll
    QtGui4.dll
    QtNetwork4.dll
    QtSql4.dll
    qsqlite4.dll

    Installed on a machine that never saw a complete Qt installation, the app starts up, does it's work fine, but opening the database file fails. QSqlDatabase::open() returns 'false'!
    After I read about plugins (like qsqlite4.dll) need to be stored in a subdir named "plugins" I tried this, but the result is the same.

    Did I forget any file for the SQL support?
    Do I need to build a special directory hirarchy?

    Thanks a lot in advance for any hint.

    Kind regards
    Joerg

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rcari
      wrote on last edited by
      #2

      You must put qsqlite4.dll in a subfolder as such: plugins/sqldrivers as explained "here":http://doc.qt.digia.com/latest/plugins-howto.html.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        joergpauly
        wrote on last edited by
        #3

        Hello, rcari,

        thank you, but that didn't work.

        I put qsqlite4.dll into %ApplicationDirectory%/plugins/sqldrivers.
        All directories have been created in a valid state.

        In case QSqlDatabase::open() returns false I fed a QMessageBox with the output of QSqlDatabase::lastError(). It simply says "Driver not loaded"...

        I can't find the answer to this issue in the article you postet, so I need to ask, if I'd rather put the directory structure of the Qt-Libraries including the plugins/sqldrivers folder into Window's System folder or if there's a system variable to be set to point on the .dll's...?

        Sorry, but I'm a bloody beginner in Qt programming...

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rcari
          wrote on last edited by
          #4

          Actually, you don't need the plugins folder: just put sqlite4.dll in a sqldrivers folder right next to the executable.
          This has to do with the "library paths":http://qt-project.org/doc/qt-4.8/qcoreapplication.html#libraryPaths. My bad!

          1 Reply Last reply
          0
          • J Offline
            J Offline
            joergpauly
            wrote on last edited by
            #5

            Hello, rcari,

            this works. Thank you so much!!!

            Your hint concerning QCoreApplication::libraryPath() is gold worthy!

            I confess, I often lose awareness on the doc, but this one should solve quite a lot of problems in the future before they arise.

            You made my day!
            Once again: Thank you!

            Regards
            Joerg

            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