Hi ,
Please help me in loading the psql driver for QT in my Ubuntu 8.04.1 system.
Here Postgres 8.3.5 is also installed.
I had installed the QT using following commands
configure -static -nomake demos -nomake examples -nomake tools -qt-sql-psql
( As it is static , i guess no plugin option is needed )
make
sudo make install
Installation is done.
libqsqlpsql.a is created at the path /usr/local/Troll tech/Qt-4.5.1/plugins/sqldrivers
I had added the path to LIBS in makefile
i.e LIBS = -L/usr/local/Trolltech/Qt-4.5.1/plugins/sqldrivers
I had written the following code
#include<QtSql/QtSql>
#include <QtSql/QSqlDatabase>
qDebug() << "Sql Driver" << QSqlDatabase::drivers();
QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
db.setHostName("localhost");
db.setDatabaseName("template1");
db.setUserName("postgres");
qDebug() << db.lastError();
After execution , i am getting the below error.
Sql Driver ()
QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers:
QSqlError(-1, "Driver not loaded", "Driver not loaded")
It means Still Driver is not loaded.
Please mention what is missing or wrong here..
EAGERLY AWAITING THE RESPONSE.
Bookmarks