[SOLVED] - new old discution - QSqlDatabase: QPSQL driver not loaded
-
Hi,
"QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7"My system: Windows 7, Qt 5.4 installed recently, previous Qt 5.2; Postgresql 9.4 installed recently, previous Postgresql 9.3
I had Qt 5.2 installed with Postgresql 9.3, everything worked OK. after upgrading to Qt 5.4 and Postgresql 9.4, I got this error while opening the same application.
"QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7"the application didn't change.
Any idea what could be?
thank you. -
Hi,
did you check your PATH environment variable (the one in the Run part of the Project panel ? It might be still containing the path to your old PostgreSQL.
-
I meant the PostgreSQL folder
-
Good question, on Windows it's always a bit complicated. As for deployment, every dll you need should be accessible by your application, so you either need to have them in a folder in the PATH environment variable or have them in the same folder as your application. But it's also a bad idea to have every paths in your PATH variable since you could have several applications using dlls from the same library but at different versions thus there's the risk of breaking one of them. That's why Qt Creator modifies the PATH variable when you run your application so you have an isolated scope to work with.