Solved QSqlDatabase: QPSQL driver not loaded
-
PostgreSQL12.1 is for 64bit. Could this cause the problem?
-
@nkbartc said in QSqlDatabase: QPSQL driver not loaded:
PostgreSQL12.1 is for 64bit. Could this cause the problem?
If your app is 32 bit, then yes.
Regards
-
OS: win10 64bit
qt: 5.14.0
kit: msvc2017 64bit
PostgreSQL: 12.1I think I am supposed to use PostgreSQL 64bit, but I just tried with PostgreSQL 32bit. No luck.....
-
Use dependency walker on qsqlpsql.dll to see what's missing. Maybe a msvcrt runtime
-
I am using kit: msvc2017 64bit.
I suppose that I should run dependency walker on qsqlpsql.dll at
D:\Qt\5.14.0\msvc2017_64\plugins\sqldrivers ?Thanks
-
@nkbartc said in QSqlDatabase: QPSQL driver not loaded:
I suppose that I should run dependency walker on qsqlpsql.dll at
yes
-
This is what I got
-
@nkbartc press Ok, then minimize the tree on the left side, so that only one level of dependencies is visible.
The yellow warnings are harmless, AFAIK.
-
Please take a look at the direct dependencies
-
@aha_1980 @Christian-Ehrlicher
Like this? Sorry I am new to dependency walker.
-
@nkbartc Yes, like that.
Unfortunately(?) that looks all good, so this library (qsqlpsql.dll) does not seem to be the problem.
Regards
-
@nkbartc said in QSqlDatabase: QPSQL driver not loaded:
I checked "D:\Qt\5.14.0\msvc2017_64\plugins\sqldrivers\qsqlpsqld.dll" and I did found the dll which the debugger reports as missing. And I am also confused about why it complains about "'D:/Qt/5.14.0/msvc2017_64/plugins/sqldrivers/qsqlpsql.dll' uses incompatible Qt library.
On windows debug and release libraries are different binaries and can't be loaded interchangeably (unlike with linux). You probably need to build the driver with debug.
-
@nkbartc Pointing to the dll in the bin library solved the issue for me. Change the path from D:\psql\lib to D:\psql\bin