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] - new old discution - QSqlDatabase: QPSQL driver not loaded
QtWS25 Last Chance

[SOLVED] - new old discution - QSqlDatabase: QPSQL driver not loaded

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 4.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.
  • A Offline
    A Offline
    angelicaP
    wrote on last edited by
    #1

    Hi,

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

    My system: Windows 7, Qt 5.4 installed recently, previous Qt 5.2; Postgresql 9.4 installed recently, previous Postgresql 9.3

    I had Qt 5.2 installed with Postgresql 9.3, everything worked OK. after upgrading to Qt 5.4 and Postgresql 9.4, I got this error while opening the same application.

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

    the application didn't change.
    Any idea what could be?
    thank you.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      did you check your PATH environment variable (the one in the Run part of the Project panel ? It might be still containing the path to your old PostgreSQL.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        angelicaP
        wrote on last edited by
        #3

        Hi,
        thanks for your feedback.
        The PATH variable mentions the
        "C:\Qt\Qt5.4.0\5.4\mingw491_32\lib"
        path, which corresponds to the Qt 5.4 directory. Nowhere in the settings the old Qt 5.2 folder is mentioned.

        what am I doing wrong?
        thank you.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I meant the PostgreSQL folder

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            angelicaP
            wrote on last edited by
            #5

            the PostgreSql\bin\lib folder was missing from the PATH variable.
            problem solved.
            Any idea why this folder wasn't mentioned?
            thank you.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Good question, on Windows it's always a bit complicated. As for deployment, every dll you need should be accessible by your application, so you either need to have them in a folder in the PATH environment variable or have them in the same folder as your application. But it's also a bad idea to have every paths in your PATH variable since you could have several applications using dlls from the same library but at different versions thus there's the risk of breaking one of them. That's why Qt Creator modifies the PATH variable when you run your application so you have an isolated scope to work with.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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