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. POSTGRES QPSQL not loading
QtWS25 Last Chance

POSTGRES QPSQL not loading

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 4 Posters 2.3k 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.
  • K Offline
    K Offline
    kradoow
    wrote on 25 Jul 2018, 22:06 last edited by kradoow
    #1

    Windows 8.1
    postgres 10 64/32(9.6,32 9.3 32)
    QT 5.10.1
    MinGW 5.3.0 32

    I am wanting to use Qt for a postgres frontend...I am new to Qt, I have been playing with the sample programs. I loaded the SQL Browser . Every time I try to run it I get the : QSqlDatabase: QPSQL driver not loaded.
    I googled till my eyes bled following many directions, copy the LIBPQ.dll , compile my own driver(unsuccessful due to file not found issues again googled to resolve that to no avail) I am at a loss how to make this work. Most of the googled results never seem to resolve much either...Somebody must have made it work. I have tried the MSVC2015 32 and 64 also.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kradoow
      wrote on 26 Jul 2018, 17:09 last edited by
      #8

      I was able to get it to run with mingw 32 build by adding the path to the postgres/bin install to the build environment. I added it to the windows environment originally but that did not seem to work.
      So thanks all for your responses and the help. New to Qt and wanting to see if it something I want to use to connect to our database. The main reason being is we use linux also so I wanted to try it.

      Thanks again for all of your help!!!

      1 Reply Last reply
      1
      • S Offline
        S Offline
        starryeyed
        wrote on 26 Jul 2018, 10:17 last edited by
        #2

        I had issues with "Driver not loaded" with MySQL .dlls and maybe same thing can help you.

        • Make sure you got this installed
        • Check in environment variables - is the folder containing your LIBPQ.dll a part of systemwide %PATH% variable?

        P.S. If you magically make it work on some other (virtual?) machine, just run ProcExp, select the launched .exe and look for dlls in lower pane, which displays "resource dependencies". Note the path at which normally running .exe expects .dll (or something else). The key to make it launch on your machine then is to put same stuff at same paths

        1 Reply Last reply
        2
        • K Offline
          K Offline
          kradoow
          wrote on 26 Jul 2018, 14:58 last edited by kradoow
          #3

          I added the environment variable, I have the redistributes 05, 08, 10, 12, 13, 17 for (86) and 64
          it still does not work. I have no access to any virtual window machines.
          I am going to uninstall the different versions of the components and reinstall them, just to make sure I did not hose something up.
          --After reinstall of components it still does not work.
          I followed some directions I found on youtube also, about some dll's to copy to the bin and sqldriver directories to no avail.
          I failed on the second part of the video to make my own drivers, kept getting errors that some files were missing...blah, another rabbit hole I did not want to venture in.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 26 Jul 2018, 15:51 last edited by
            #4

            Did you compile Qt5 by yourself?
            Make sure that qsqlpsql(d).dll can find all it's dependencies e.g. with Dependency Walker. Otherwise the library can not be loaded.

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

            K 1 Reply Last reply 26 Jul 2018, 15:58
            2
            • C Christian Ehrlicher
              26 Jul 2018, 15:51

              Did you compile Qt5 by yourself?
              Make sure that qsqlpsql(d).dll can find all it's dependencies e.g. with Dependency Walker. Otherwise the library can not be loaded.

              K Offline
              K Offline
              kradoow
              wrote on 26 Jul 2018, 15:58 last edited by kradoow
              #5
              This post is deleted!
              1 Reply Last reply
              0
              • C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 26 Jul 2018, 16:02 last edited by
                #6

                Did you checked the dependencies with Dependency Walker? It's for sure that a needed library is not in your PATH (or maybe there is, but for the wrong architecture... ).

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

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mchinand
                  wrote on 26 Jul 2018, 16:09 last edited by
                  #7

                  When adding the path of libpq.dll, add it to the beginning of your path (when running from QtC, I modify the PATH environment variable to the 'run' configuration instead of my user PATH). I had a similar problem with using postgres and I think there was an older version of the dll somewhere in my path that was causing problems. I'm not sure what version of Postgresql QT expects (or how dependent on the version it is), but 9.6 works for me. Also, run the dependency walker on the qt postgres plugin dll as @Christian-Ehrlicher suggested.

                  1 Reply Last reply
                  2
                  • K Offline
                    K Offline
                    kradoow
                    wrote on 26 Jul 2018, 17:09 last edited by
                    #8

                    I was able to get it to run with mingw 32 build by adding the path to the postgres/bin install to the build environment. I added it to the windows environment originally but that did not seem to work.
                    So thanks all for your responses and the help. New to Qt and wanting to see if it something I want to use to connect to our database. The main reason being is we use linux also so I wanted to try it.

                    Thanks again for all of your help!!!

                    1 Reply Last reply
                    1

                    4/8

                    26 Jul 2018, 15:51

                    • Login

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