QPSQL driver not loaded
-
Hello , I have been ramming my head against the for some hours.
I created a simple database with a QPSQL driver , however , I get this:QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMIMER QODBC QPSQLI have the 4 files regarding psql in plugins section of the MSVC2019 compiler:
qsqlpsql.dll
qsqlpsql.pdb
qsqlpsqld.dll
qsqlpsqdl.dpdso I don't think there is a problem here.
Saw a post from 2014 and a Youtube tutorial on this , a they had a .pro file in C:\Qt\6.6.1\Src\qtbase\src\plugins\sqldrivers\psql , which I don't. Which is used to build the driver.
I used this https://doc.qt.io/qt-6/sql-driver.html , and I guess the commands should be run in C:\Qt\6.6.1\Src , however , they don't work.
Added to PATH enviroment variable:
C:\Program Files\PostgreSQL\16\bin
C:\Program Files\PostgreSQL\16\lib
as this brother said
https://www.qtcentre.org/threads/59024-Building-Postgresql-driverPlease help , I have tried much and it still doesn't work. Saw a post that said to reintall qt as a whole , and when it sees PostgreSql on my PC , it will do the things I need to do automatically. I consider this as a final option.
-
Hello , I have been ramming my head against the for some hours.
I created a simple database with a QPSQL driver , however , I get this:QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMIMER QODBC QPSQLI have the 4 files regarding psql in plugins section of the MSVC2019 compiler:
qsqlpsql.dll
qsqlpsql.pdb
qsqlpsqld.dll
qsqlpsqdl.dpdso I don't think there is a problem here.
Saw a post from 2014 and a Youtube tutorial on this , a they had a .pro file in C:\Qt\6.6.1\Src\qtbase\src\plugins\sqldrivers\psql , which I don't. Which is used to build the driver.
I used this https://doc.qt.io/qt-6/sql-driver.html , and I guess the commands should be run in C:\Qt\6.6.1\Src , however , they don't work.
Added to PATH enviroment variable:
C:\Program Files\PostgreSQL\16\bin
C:\Program Files\PostgreSQL\16\lib
as this brother said
https://www.qtcentre.org/threads/59024-Building-Postgresql-driverPlease help , I have tried much and it still doesn't work. Saw a post that said to reintall qt as a whole , and when it sees PostgreSql on my PC , it will do the things I need to do automatically. I consider this as a final option.
@OniFloppa
Do you have the message when run the project on Qt creator or when do you distribute it?
Copy the DLL of bin folder in the executable of your project. All are not necessary, but it is an easy way to test. -
Hi and welcome to devnet,
Start your application with the QT_DEBUG_PLUGINS environment variable set to 1. That will dump the plugin information and you should see why it's not getting loaded.
-
Hi and welcome to devnet,
Start your application with the QT_DEBUG_PLUGINS environment variable set to 1. That will dump the plugin information and you should see why it's not getting loaded.
@SGaist So the last thing I tried was :
@OniFloppa said in QPSQL driver not loaded:
Added to PATH enviroment variable:
C:\Program Files\PostgreSQL\16\bin
C:\Program Files\PostgreSQL\16\libIt didn't work , made this post , and went to bed. I was about to implement what you said , but I think the last step was to restart Qt Creator , because it works now! Thanks for the response anyway.
-
-
@SGaist So the last thing I tried was :
@OniFloppa said in QPSQL driver not loaded:
Added to PATH enviroment variable:
C:\Program Files\PostgreSQL\16\bin
C:\Program Files\PostgreSQL\16\libIt didn't work , made this post , and went to bed. I was about to implement what you said , but I think the last step was to restart Qt Creator , because it works now! Thanks for the response anyway.
@OniFloppa Some programs only work on certain days (especially under Windows).... ;)