QSqlDatabase: QPSQL driver not loaded
-
@nkbartc said in QSqlDatabase: QPSQL driver not loaded:
Cannot load library D:\Qt\5.14.0\msvc2017_64\plugins\sqldrivers\qsqlpsql.dll: The specified module could not be found.
QLibraryPrivate::loadPlugin failed on "D:/Qt/5.14.0/msvc2017_64/plugins/sqldrivers/qsqlpsql.dll" : "Cannot load library D:\Qt\5.14.0\msvc2017_64\plugins\sqldrivers\qsqlpsql.dll: The specified module could not be found."You're most likely missing libpq.dll in your PATH / in your folder of your executable.
-
@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
-
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
-
Please take a look at the direct dependencies
-
@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.