It looks like it can't find the PostgreSQL client library. Find that file and copy it to the same directory where your executable is (you might need other DLLs too, so check it with Dependency Walker).Originally Posted by graeme
It looks like it can't find the PostgreSQL client library. Find that file and copy it to the same directory where your executable is (you might need other DLLs too, so check it with Dependency Walker).Originally Posted by graeme
Just done that and whilst Dependency Walker is now happy, my app refuses to play ball![]()
I have now put the driver along with the dlls in the plugin directory and in an sqldrivers directory in the same direcotiry as the executable but no joy.
Are you 100% sure that both the plugin and the application were built in the same mode (i.e. both in debug mode or both in release mode)?Originally Posted by graeme
I have both versions of the plugin qsqlpsql.dll & qsqlpsqld.dll.
I tried with a release version of my app, followed by a debug version. I currently have a debug version.
The postgresql dll are (I believe) release versions (no *d.dll)
Should I just revert to the release version of the app?
No, since you have both versions of the plugin.Originally Posted by graeme
What does exactly QSqlDatabase::drivers() return when you invoke it from your application? What parameters do you pass to QSqlDatabase::addDatabase()?
drivers returns:
QSQLITE
QODBC3
QODBC
The code you requested is:
Qt Code:
// Get the connection, if it exists // Check that the driver is availableTo copy to clipboard, switch view to plain text mode
followed by:
The result is "... The Database driver QPSQLis not available"Qt Code:
// Okay the connection doesn't exist so let's add it using the appropriate driver typeTo copy to clipboard, switch view to plain text mode
Last edited by graeme; 17th April 2006 at 20:22.
This is weird. I've never had any problems with QPSQL driver on windows.
What compiler do you use? I guess you use MinGW, if you got an .a file, but then you shouldn't be able to use the libpq.lib file.Originally Posted by graeme
Try:qmake -o Makefile "INCLUDEPATH+=C:\psql\include" "LIBS+=C:\psql\lib" psql.pro
I'm using Mingw32
The switch you suggest gives an error:
C:\psql\lib: No such file
following you line of thought (I believe) I tried
qmake -o Makefile "INCLUDEPATH+=C:\psql\include" "LIBS+=C:\psql\lib\libpq.a" psql.pro
that created the files but still nothing when I run the program
Yes, or "LIBS+= -LC:\psql\lib\ -lpq".Originally Posted by graeme
I hope you have removed all copies of the old driver.Originally Posted by graeme
I always configure Qt like this:Which Qt version do you use exactly? In one of the older versions one had to remove some keys from the registry in case of problems with plugins. It was something around HKEY_CURRENT_USER\Software\Trolltech\OrganizationD efaults\Qt Plugin Cache...configure -L C:\...\psql\lib -I C:\...\psql\include -plugin-sql-psql ...
I'm using 4.1.1
I removed the old drivers, in fact I renamed the old file ran my program - no drivers. Copied the qsqlited.dll into the sqldrivers folder of my app it found that driver. Removed it - no drivers.
Then ran the make. It created a new sqldrivers directory with the new psql driver. I copied it into my program sqldrivers directory and deleted it from the qt directory. But alas...
I'll look for the registry entry.
The registry only has the default value
If there was a problem with loading the driver Qt marked such plugin as invalid in the registry and then just ignored it (even after the problem was fixed), but AFAIR this was Qt 4.0.0 or 4.0.1.Originally Posted by graeme
Okay I'm running out of ideas.
From all of this I believe that the problem lies with how the dll is being created. So would getting an MS compiler help? I guess that I could download their C++ compiler and try it out. Or would it be better to configue and rebuild Qt?
Bookmarks