Results 1 to 5 of 5

Thread: QPSQL driver not loaded

  1. #1
    Join Date
    Aug 2019
    Posts
    15
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default QPSQL driver not loaded

    I am using Qt 5.9.3 version with PostgreSQL 9.4 . Whenever I am trying to connect to my postgres database it is showing as QPSQL database driver not loaded. I have gone through previous threads on this topic and have included libeay32.dll, libintl-8.dll, libpq.dll and ssleay32.dll into my mingw bin but nothing seems to be working out. Please help me out in this regard.

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver not loaded

    In folder <POSTGRESQL>\installer is located MSVC runtime vcredist_x86.exe. Try to run it once.

  3. #3
    Join Date
    Aug 2019
    Posts
    15
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QPSQL driver not loaded

    Tried running it. It is vcredist_x64 for me. same problem persists.
    Thanks for the reply. I am using mingw as my compiler

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL driver not loaded

    I'm not sure if you can directly combine MSVC dlls with mingw code. I understand that your application is 64-bit.

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QPSQL driver not loaded

    In addition to the Qt PSQL driver library, aren't there client-side PSQL shared libraries that also need to be present and loadable? I know this is the case for MySQL.

    It is unfortunate that Qt reports that a DB driver is available (in the available drivers list) simply if it detects the corresponding Qt driver DLL, without checking to see if the files needed to actually use that driver can be loaded as well. This has been the source of many, many posts on this forum and elsewhere.

    I'm not sure if you can directly combine MSVC dlls with mingw code.
    I would guess that if the DLLs are C++ based, the name-mangling between MSVC++ and mingw-gcc would be different and incompatible. C-only DLLs are probably compatible since there is no name-mangling that I'm aware of. It sort of has to be, otherwise I would think that mingw wouldn't be able to use the low-level Windows runtime DLLs (kernel32, etc.)
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. qpsql driver Qt 5.0.1 postgresql 9.2.3
    By avpro in forum Newbie
    Replies: 6
    Last Post: 8th June 2013, 21:24
  2. QSqlDatabase: QPSQL driver not loaded
    By mistu in forum Qt Programming
    Replies: 0
    Last Post: 18th September 2012, 11:54
  3. QPSQL driver not loaded
    By drave in forum Newbie
    Replies: 4
    Last Post: 4th May 2010, 14:11
  4. Replies: 4
    Last Post: 10th November 2009, 20:48
  5. QPSQL - Driver Not Loaded (WIN XP)
    By db in forum Qt Programming
    Replies: 8
    Last Post: 14th September 2009, 02:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.