Driver not loaded, but driver is present
I get this error at runtime:
QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
As the error itself displays, postgres driver is already present. Indeed there's a
I have not built it and I have no Postgres installation on this machine (I test on my Linux OS and deploy on Windows 8.1 VM), the driver was already present after installing QT.
Please help me.
Beside plugins for sqldrivers you need drivers itself. For PostgreSQL 9.6 the necessary files are these:
libeay32.dll libiconv-2.dll libintl-8.dll libpq.dll ssleay32.dll
Place them in the folder of your *.exe file.
You can get them from zip archive of the binaries if you don't want to install PostgreSQL.
Note that you will need files for the same system version like your Qt version.
If you use MinGW32 (witch is only 32-bit) you need these files from 32-bit version of PostgreSQL.
If you use MSVC x64 you need these files from 64-bit version of PostgreSQL.