[SOLVED]Postgres Driver on Ubuntu
I already readed docs on the forum. But nothing works until now.
@ QSqlDatabase *db = new QSqlDatabase();
qDebug() << qApp->libraryPaths();
bool ok = db->open("brochadinho","12345");
qDebug()<<"sucesso a ligar a base de dados de teste";
@("QSQLITE", "QMYSQL", "QMYSQL3", "QPSQL", "QPSQL7")
Erro: "Driver not loaded Driver not loaded"@
and then i tried to compile the driver and...
@brochadinho@luispc:~/Qt/5.3/Src/qtbase/src/plugins/sqldrivers/psql$ qmake "INCLUDEPATH+=/usr/include/postgresql" "LIBS+=-L/usr/lib -lpq" psql.pro
WARNING: /home/brochadinho/Qt/5.3/Src/qtbase/src/plugins/sqldrivers/qsqldriverbase.pri:4: Unable to find file for inclusion qt_plugin
Project MESSAGE: Warning: unknown QT: core-private
Project MESSAGE: Warning: unknown QT: sql-private
i have Qt Creator 3.2.2 (opensource) Based on Qt 5.3.2 (GCC 4.6.1, 64 bit) on a ubuntu 14.04 LTS 64bit. the postgres was installed via apt-get postegres.
Any sugestion how to put this working? at have been struglling with this, for 2 days.
thanks for all the help.
Are you sure that the qmake you are calling is the one from Qt 5.3 ? Also, from what I read, you already have the plugin built. You should run ldd on the original plugin to see if you have a missing dependency.
Hope it helps
Hi thanks for the reply.
U are right about the qmake thing.But something real weird is happening. I Compile the drilldown example, and i made some changes and it worked.
@ QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
I allready, tried this snippet on my project, and it worked.
Looks like the problem was the db.port wasn't define. But im not sure. as long as it works, i don't care.
Some database system needs more information than others so it might very well be that.