PDA

View Full Version : Postgres, "driver not load" in debug mode



ithanoss
26th October 2010, 21:53
Hello.

I'm having trouble connecting to the PostgreSQL database in debug mode. When connecting to a database in debug mode I get the error "driver not load." In relase mode, the program works as expected. The error occurs in the default installation Qt for visual 2008.

So i compiled the plugin by http://doc.qt.nokia.com/4.7/sql-driver.html#qpsql but then I get the error "driver not load" in debug mode and relase. Anyone knows how to work with postgres in debug mode?

I'm using PostgreSQL 8.4.5, the compiler VC9 (Visual 2008), and Win 7 and XP.

System Paths are set correctly.
c:\Qt\Qt4.7.0\ bin
c:\Postgres\8.4\ lib
QTDIR=c:\Qt\Qt4.7.0

Thanks, for reply.
Regards

wysota
26th October 2010, 22:36
You need a plugin for handling postgresql in Qt built in debug mode.

ithanoss
27th October 2010, 10:16
I have added to the configuration CONFIG+= debug. After compiling qsqlpsqld.dll plugin is created in C:\qt\4.7.0.\plugins\sqldrivers\ but is strangely small - 67 KB. Version of qt is 223kB. Unfortunately the error still occurs.

wysota
27th October 2010, 10:37
You probably built it with different options (or a different compiler) than your Qt installation is using. You can use the Dependency Walker to check dependencies of the plugin.

ithanoss
27th October 2010, 17:19
The solution was simple.
Just copy the dll files from postgres bin directory to qt bin directory or add to system paths postgres bin directory and recompile plugin.
The solution comes from the polish forum qt www.devqt.pl

120decibel
6th April 2011, 21:34
Thanks so much!! That did the trick for me!!