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. QLibraryPrivate::loadPlugin failed on "C:/Qt/Qt5.14.2/5.14.2/mingw73_32/plugins/sqldrivers/qsqlpsql.dll"
Forum Updated to NodeBB v4.3 + New Features

QLibraryPrivate::loadPlugin failed on "C:/Qt/Qt5.14.2/5.14.2/mingw73_32/plugins/sqldrivers/qsqlpsql.dll"

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 414 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
    Ascs
    wrote on last edited by
    #1

    Hi:
    I have a weird problem:
    This is my code:
    QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL"); //QMYSQL
    db.setHostName("127.0.0.1");
    db.setDatabaseName("testdatabase");
    db.setUserName("root");
    I have already set “QT_DEBUG_PLUGINS” to 1
    and this is my log:
    Cannot load library C:\Qt\Qt5.14.2\5.14.2\mingw73_32\plugins\sqldrivers\qsqlpsql.dll: 找不到指定的模块。
    QLibraryPrivate::loadPlugin failed on "C:/Qt/Qt5.14.2/5.14.2/mingw73_32/plugins/sqldrivers/qsqlpsql.dll" : "Cannot load library C:\Qt\Qt5.14.2\5.14.2\mingw73_32\plugins\sqldrivers\qsqlpsql.dll: 找不到指定的模块
    But this picture is my qt mingw dictory:
    屏幕截图 2024-05-31 134635.png
    The file “qsqlpsql.dll” exists,why it fails?
    This file is compiled. There is no error in the compilation.
    32-bit postgresql, version 10.23
    32-bit Qt 5.14.2
    32-bit MinGW
    My System is 64 bit Window 11

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #5

      Please expand all dlls - I'm pretty sure libpq.dll is missing some dependencies.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      A 1 Reply Last reply
      1
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        You have to make sure that the dependencies of qsqlpsql.dll are available in the PATH (some postgresql dlls). If you don't know which dependencies are needed you can use a dependency checker to find it out.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        A 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          You have to make sure that the dependencies of qsqlpsql.dll are available in the PATH (some postgresql dlls). If you don't know which dependencies are needed you can use a dependency checker to find it out.

          A Offline
          A Offline
          Ascs
          wrote on last edited by
          #3

          @Christian-Ehrlicher Thank you for your reply, I checked the dependencies.
          this is all information. I think it is OK, 32 bit dll file so C:\WINDOWS\SysWOW64\kernel32.dll
          屏幕截图3.png

          A 1 Reply Last reply
          0
          • A Ascs

            @Christian-Ehrlicher Thank you for your reply, I checked the dependencies.
            this is all information. I think it is OK, 32 bit dll file so C:\WINDOWS\SysWOW64\kernel32.dll
            屏幕截图3.png

            A Offline
            A Offline
            Ascs
            wrote on last edited by
            #4

            屏幕截图7.png

            1 Reply Last reply
            0
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #5

              Please expand all dlls - I'm pretty sure libpq.dll is missing some dependencies.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              A 1 Reply Last reply
              1
              • Christian EhrlicherC Christian Ehrlicher

                Please expand all dlls - I'm pretty sure libpq.dll is missing some dependencies.

                A Offline
                A Offline
                Ascs
                wrote on last edited by
                #6

                @Christian-Ehrlicher You are right!屏幕截图8.png

                The solution is to copy the relevant dll in the bin directory of pgsql installation to the bin directory of mingw

                1 Reply Last reply
                1
                • A Ascs has marked this topic as solved on

                • Login

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