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. QSQL driver not found
Qt 6.11 is out! See what's new in the release blog

QSQL driver not found

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 2.0k 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.
  • L Offline
    L Offline
    luca72
    wrote on last edited by
    #1

    Hello i'm under linux i get this error:

    Starting /home/luca72/build-Panth-Desktop_Qt_5_0_2_GCC_64bit-Debug/Panth...
    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE

    in the folder /usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/
    i have only the file libqsqlpsql.so

    and in the folder /usr/lib/x86_64-linux-gnu/qt4/plugins/sqldrivers/
    i have : libqsqlpsql.so libqsqlite.so and libqsqlmysql.so.

    So i don't know how i see only the driver for sqlite

    Now i have to use psql, how i have to do

    Thanks

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,

      @
      QSqlDatabase: QPSQL driver not loaded
      @

      probaly means that the libpq.dll isn't in your PATH.

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nunu
        wrote on last edited by
        #3

        Hi,

        Is this a program you wrote, if so what code did you use to load the driver?

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

          You need to compile this driver with your new qt library, because
          bq. /usr/lib/x86_64-linux-gnu/qt4/plugins/sqldrivers/
          i have : libqsqlpsql.so libqsqlite.so and libqsqlmysql.so.

          is old one and you use another
          bq. Qt_5_0_2

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mcosta
            wrote on last edited by
            #5

            Hi,

            when you use
            @
            QSqlDatabase::addDatabase (<driver_name>);
            @

            Qt automatically try to load the specified driver; to successfully load driver you MUST:

            • have the Qt SQL Driver Plugin installed on right Qt path
            • have database client library (libpq.so for PostgreSQL) in a directory listed in PATH environment variable

            Once your problem is solved don't forget to:

            • Mark the thread as SOLVED using the Topic Tool menu
            • Vote up the answer(s) that helped you to solve the issue

            You can embed images using (http://imgur.com/) or (http://postimage.org/)

            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