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. QMYSQL , QPSQL , QPSQL7 ! Driver not found

QMYSQL , QPSQL , QPSQL7 ! Driver not found

Scheduled Pinned Locked Moved Solved General and Desktop
19 Posts 4 Posters 2.7k 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.
  • T tmapp
    23 Sept 2020, 16:22

    @JonB
    in the project setting i added it in the environement build :
    Capture.PNG

    and the last output i'm getting now :
    Cannot load library C:\Qt\QT5\5.15.1\mingw81_32\plugins\sqldrivers\qsqlpsql.dll: The specified module could not be found.
    QLibraryPrivate::loadPlugin failed on "C:/Qt/QT5/5.15.1/mingw81_32/plugins/sqldrivers/qsqlpsql.dll" : "Cannot load library C:\Qt\QT5\5.15.1\mingw81_32\plugins\sqldrivers\qsqlpsql.dll: The specified module could not be found."
    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7

    J Offline
    J Offline
    JonB
    wrote on 23 Sept 2020, 16:24 last edited by
    #9

    @tmapp
    So you have only just done that change now? At least it tells us something then: is the qsqlpsql.dll file indeed not in the directory it shows you it is looking for it?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tmapp
      wrote on 23 Sept 2020, 16:34 last edited by
      #10

      the specified file exist in the path :
      Capture.PNG

      J 2 Replies Last reply 23 Sept 2020, 16:41
      0
      • T tmapp
        23 Sept 2020, 16:34

        the specified file exist in the path :
        Capture.PNG

        J Offline
        J Offline
        JonB
        wrote on 23 Sept 2020, 16:41 last edited by JonB
        #11

        @tmapp
        I am not an expert here, but: I believe that if that .DLL file has missing dependencies (other DLLs) which it cannot find or cannot load, the error message you get is that the first one "could not be found", like yours shows. There is some Windows Dependency Walker app you can download which would allow you to see what other DLLs that DLL needs.

        That's all I know, unless someone else knows better. You might find other references if you Google/search this forum for QPSQL driver not loaded.

        M 1 Reply Last reply 23 Sept 2020, 16:44
        1
        • J JonB
          23 Sept 2020, 16:41

          @tmapp
          I am not an expert here, but: I believe that if that .DLL file has missing dependencies (other DLLs) which it cannot find or cannot load, the error message you get is that the first one "could not be found", like yours shows. There is some Windows Dependency Walker app you can download which would allow you to see what other DLLs that DLL needs.

          That's all I know, unless someone else knows better. You might find other references if you Google/search this forum for QPSQL driver not loaded.

          M Offline
          M Offline
          mchinand
          wrote on 23 Sept 2020, 16:44 last edited by
          #12

          @JonB Yes, the Postgres client dll (libpq.dll) and its dependencies also need to be in your path. I'm not sure if the libpq.dll and its dependencies that come with Postgres are compatible with minwgw.

          T 1 Reply Last reply 23 Sept 2020, 16:50
          1
          • T tmapp
            23 Sept 2020, 16:34

            the specified file exist in the path :
            Capture.PNG

            J Offline
            J Offline
            JonB
            wrote on 23 Sept 2020, 16:45 last edited by
            #13

            @tmapp
            See @mchinand's post above, this is just the sort of cause. And I can leave you in his hands :)

            1 Reply Last reply
            0
            • M mchinand
              23 Sept 2020, 16:44

              @JonB Yes, the Postgres client dll (libpq.dll) and its dependencies also need to be in your path. I'm not sure if the libpq.dll and its dependencies that come with Postgres are compatible with minwgw.

              T Offline
              T Offline
              tmapp
              wrote on 23 Sept 2020, 16:50 last edited by
              #14

              @mchinand
              i copied files in the bin path of the mingw folder (libpq.dll and other dll found in a video of postgresql in youtube ) but doesn't work. I started by Mysql and when i saw qpsql*.dll I changed to it but same errors.
              @JonB first thank you very much for your help and time , second yeah naturally i google it before , this is my first time posting a question in a forum, all times i google, but this one !

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mchinand
                wrote on 23 Sept 2020, 19:17 last edited by
                #15

                libpq.dll is for connecting to a Postgresql database not a Mysql database (not sure why you mentioned MySql in your most recent reply). Also, these dlls will also have to be 32-bit since your application is 32-bit.

                T 1 Reply Last reply 23 Sept 2020, 19:50
                0
                • M mchinand
                  23 Sept 2020, 19:17

                  libpq.dll is for connecting to a Postgresql database not a Mysql database (not sure why you mentioned MySql in your most recent reply). Also, these dlls will also have to be 32-bit since your application is 32-bit.

                  T Offline
                  T Offline
                  tmapp
                  wrote on 23 Sept 2020, 19:50 last edited by
                  #16

                  @mchinand the dlls are 32bit, and about Mysql , it's just mentioning that i tried MySQL first and yet the same problem goes for PostgreSQL dunna know why! only QSQLITE WORK !!!

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mchinand
                    wrote on 23 Sept 2020, 20:04 last edited by
                    #17

                    Where did you get the libpq and related dlls? You should copy them to the same folder as your project's executable (looks like build-sqlbrowser-Desktop_Qt_15_1_MinGW_32_bit-Debug) or add whatever folder they are in to your PATH environment variable (and restart QtCreator aftewards).

                    T 1 Reply Last reply 23 Sept 2020, 22:59
                    0
                    • M mchinand
                      23 Sept 2020, 20:04

                      Where did you get the libpq and related dlls? You should copy them to the same folder as your project's executable (looks like build-sqlbrowser-Desktop_Qt_15_1_MinGW_32_bit-Debug) or add whatever folder they are in to your PATH environment variable (and restart QtCreator aftewards).

                      T Offline
                      T Offline
                      tmapp
                      wrote on 23 Sept 2020, 22:59 last edited by
                      #18

                      @mchinand same problem , no result . I even tried to remake the driver yet an error occured when making :

                      g++: error: unrecognized command line option '-std=c++1z'
                      g++: error: unrecognized command line option '-Wshift-overflow=2'
                      g++: error: unrecognized command line option '-Wduplicated-cond'
                      mingw32-make[2]: *** [Makefile.Release:403: .obj/release/qsql_sqlite.o] Error 1
                      mingw32-make[2]: Leaving directory 'C:/Qt/QT5/5.15.1/Src/qtbase/src/plugins/sqldrivers/sqlite'
                      mingw32-make[1]: *** [Makefile:45: release] Error 2
                      mingw32-make[1]: Leaving directory 'C:/Qt/QT5/5.15.1/Src/qtbase/src/plugins/sqldrivers/sqlite'
                      mingw32-make: *** [Makefile:50: sub-sqlite-make_first] Error 2
                      
                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        tmapp
                        wrote on 24 Sept 2020, 00:33 last edited by
                        #19

                        Hi Again , I solved the problem :: i had to remake the driver and after googling and looking in the forum many guys had the same problem with the actual driver and remaking new one. Here is how to do :

                        • I'm using Postgresql 10.
                        1. you need to download the zip file of postgresql where source code exist.
                        2. lunch the Qt Mingw console.
                        3. copy all the file exists in the include path of the download zip in %Path_TO_QT\src\qtbase\plugins\sqldrivers\psql  
                          ( if you don't you'll have problems with include files .h in mingw32-make
                        4. make sur to copy the lib files to the same folder psql ( libpq.dll , libeay32.dll, libintl , libiconv, ssleay32.dll ) ssleay32 you can have i from the net ( i got it from my xampp folder) 
                        5. edit the file psql.pro and comment : QMAKE_USE += psql  with a #
                          if you don't you'll have error : psql model not defined
                        6. run the qmake command as follow: qmake "INCLUDEPATH+=PATH_TO_DOWNLOAD_SOURCE\pgsql\include" "LIBS+=PATH_TO_DOWNLOADED_SOURCE\pgsql\lib" psql.pro
                          here PATH_TO_DOWNLOAD_SOURCE mean the path to the download zip extracted
                        7. run mingw32-make
                        8. run mingw32-make install
                        

                        Congrats.
                        @Christian-Ehrlicher @JonB @mchinand thanks for your time and help :)

                        1 Reply Last reply
                        2

                        18/19

                        23 Sept 2020, 22:59

                        • Login

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