View Full Version : postgresSQL compiled but canot be used

29th March 2011, 13:31

I've just solved the problems around installing and building PostgresSQL, and it seems to have worked. Or at least I think so as there are these filea:
c:\Qt\2010.05\qt\plugins\sqldrivers\libqsqlpsqld4. a

When I'm trying to compile my first small testapplication, it still has the message:
QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC

Just as if nothing has happened. :(
Is there anything more I should do before using this plugin?

29th March 2011, 13:50
Is your bin folder of PostgreSQL in path?

29th March 2011, 14:06
Where can I set it? Is it goung to be in the pro file? I can't find the proper keywords for a succesful google search :(
I'm using the Creator, I can see there is an option under Build Settings -> General, but if I'm right that is for qmake.

29th March 2011, 14:44
This is a property of operating system and users session not Qt.

29th March 2011, 14:52
Lesiok is right so try http://lmgtfy.com/?q=setting+PATH+in+windows

30th March 2011, 03:05
In Qt Creator you can set which Qt Version to use. It seems that you have more than one version installed and QPSQL driver is not installed in one you are using.
Try to put in your code qApp.addLibraryPath("path") where "path" is the path where your sqldrivers are installed, in your case "c:\Qt\2010.05\qt\plugins\sqldrivers". Do it before creating db connection or load the drivers and see if it works. If this is the case set the Qt version that creator use for your project.

I am not sure if I help much. I am only a beginner in Qt. :)

30th March 2011, 11:06
thank you guys, tha problem was that the path was not set. When I addded, it started to live. :)