PDA

View Full Version : QPSQL driver not loaded



supratik
28th August 2019, 06:55
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.

Lesiok
28th August 2019, 07:28
In folder <POSTGRESQL>\installer is located MSVC runtime vcredist_x86.exe. Try to run it once.

supratik
28th August 2019, 07:41
Tried running it. It is vcredist_x64 for me. same problem persists.
Thanks for the reply. I am using mingw as my compiler

Lesiok
28th August 2019, 08:39
I'm not sure if you can directly combine MSVC dlls with mingw code. I understand that your application is 64-bit.

d_stranz
28th August 2019, 16:54
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.)