QPSQL driver not loaded - unusual solution

From QT Wikipedia

Jump to: navigation, search

Recently had a lot of trouble making QPSQL driver available in QT 4.3.1 version. But fun part was that - driver loaded correctly then i copied all dll from {%pgsql)\bin\ files to executable directory.

Copied files list.

 
comerr32.dll
depends.dll
gssapi32.dll
iconv.dll
k5sprt32.dll
krb5_32.dll
libeay32.dll
libiconv2.dll
libintl3.dll
libpq.dll
libxml2.dll
libxslt.dll
ssleay32.dll
 

Another interesting thing, that if I rename qsqlpsql4.dll to something else, driver still loads correctly :D :D. Perhaps I'm missing something, but at least it works now :)

By the way if drivers still does not get loaded try add this line in main.cpp file

 
qApp->addLibraryPath( qApp->applicationDirPath() + "/plugins");
 

And plugins directory should look like : plugins\sqldrivers\qsqlpsql4.dll


Personal tools
Toolbox