Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved QPSQL driver not loaded -> available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7

    Installation and Deployment
    2
    4
    7176
    Loading More Posts
    • 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.
    • N
      noIdea last edited by

      Hello

      I'm relatively new to QT and C++.

      I've experience in PHP (OOP), Webdevelopement and C.
      Just for imagine with whom you are working with ;).

      I'm working on windows 7 64 Bit.
      QT 5.10.0 and Visual Studio Community 2017 15.5.1.

      I'm working here with somebody who created a program which connects to a PostgresSQL 9.3 all works fine for him. So now I just want to support him and installed everything (already multiply times).

      But I always get the same error:
      "QSqlDatabase: QPSQL driver not loaded
      QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7"

      I already tried to build the driver by my self but there are many things different to the instructions and got a lot of errors.
      Then I loaded the books example (http://doc.qt.io/qt-5/qtsql-books-example.html) it just works fine.

      Now I change this to QPSQL and I get the exactly same error.

      QSqlError initDb()
      {
      
             QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
             db.setHostName("bigblue");
             db.setDatabaseName("flightdb");
             db.setUserName("acarlson");
             db.setPassword("1uTbSbAs");
             bool ok = db.open();
             ...
      

      I don't know if I'm correct but i'm thinking I should get something like "Wrong username/password can't connect" or "Can't connect to database" instead of the driver....
      => Ok just tested.... my workmate (where it is working) get another message the one I would expect...

      So I already tried everything I'm able to.

      Anyone any idea what I should do?
      I just want that the driver works!

      Thank you very much

      S 1 Reply Last reply Reply Quote 0
      • S
        Stoyan @noIdea last edited by

        @noIdea
        It seems that drivers for PostgreSQL are missing (not deployed).
        Example works because it uses SQLite and its drivers are integrated in Qt.
        Look at this for what is necessary for PostgreSQL:
        https://forum.qt.io/topic/81148/cannot-install-postgresql-driver/7

        1 Reply Last reply Reply Quote 2
        • N
          noIdea last edited by

          libeay32.dll
          libintl-8.dll
          libpq.dll
          ssleay32.dll

          copied these files from "\PostgreSQL\9.3\bin"
          (libiconv-2.dll doesn't exist)

          and it works!

          Thank you very much :)

          S 1 Reply Last reply Reply Quote 2
          • S
            Stoyan @noIdea last edited by

            @noIdea said in QPSQL driver not loaded -> available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7:

            (libiconv-2.dll doesn't exist)

            The file "libiconv-2.dll" does exist and is necessary for PostgreSQL 9.4 and later.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post