Hi,
I have to separate test projects with almost the same code. PostgreSQL driver is loaded in one of them only. Could You help me?
It is loaded here:
with this driversCode:
#include <QtGui/QApplication> #include <QtSql> #include <QMessageBox> #include "dialog.h" int main(int argc, char *argv[]) { DB_test_Dialog w; w.show(); return a.exec(); }
DRIVERS : ("QSQLITE", "QODBC3", "QODBC", "QPSQL7", "QPSQL")
and not loaded here:
with this message:Code:
#include <QtGui/QApplication> #include <QtSql> #include <QMessageBox> #include "widget.h" int main(int argc, char *argv[]) { Widget w; w.show(); return a.exec(); }
QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL3 QMYSQL
DRIVERS : ("QSQLITE", "QMYSQL3", "QMYSQL")
I use the same enviroment.
Added after 57 minutes:
OK. It is a path issue. Once I addI get all drivers and no error message issued.Code:
a.addLibraryPath("path");
I am using QT creator for building. Where can I set these paths? Why one of the test projects works correctly?