QMYSQL , QPSQL , QPSQL7 ! Driver not found
-
@JonB
in the project setting i added it in the environement build :
and the last output i'm getting now :
Cannot load library C:\Qt\QT5\5.15.1\mingw81_32\plugins\sqldrivers\qsqlpsql.dll: The specified module could not be found.
QLibraryPrivate::loadPlugin failed on "C:/Qt/QT5/5.15.1/mingw81_32/plugins/sqldrivers/qsqlpsql.dll" : "Cannot load library C:\Qt\QT5\5.15.1\mingw81_32\plugins\sqldrivers\qsqlpsql.dll: The specified module could not be found."
QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7 -
wrote on 23 Sept 2020, 16:34 last edited by
-
wrote on 23 Sept 2020, 16:41 last edited by JonB
@tmapp
I am not an expert here, but: I believe that if that.DLL
file has missing dependencies (other DLLs) which it cannot find or cannot load, the error message you get is that the first one "could not be found", like yours shows. There is some Windows Dependency Walker app you can download which would allow you to see what other DLLs that DLL needs.That's all I know, unless someone else knows better. You might find other references if you Google/search this forum for
QPSQL driver not loaded
. -
@tmapp
I am not an expert here, but: I believe that if that.DLL
file has missing dependencies (other DLLs) which it cannot find or cannot load, the error message you get is that the first one "could not be found", like yours shows. There is some Windows Dependency Walker app you can download which would allow you to see what other DLLs that DLL needs.That's all I know, unless someone else knows better. You might find other references if you Google/search this forum for
QPSQL driver not loaded
. -
@JonB Yes, the Postgres client dll (libpq.dll) and its dependencies also need to be in your path. I'm not sure if the libpq.dll and its dependencies that come with Postgres are compatible with minwgw.
wrote on 23 Sept 2020, 16:50 last edited by@mchinand
i copied files in the bin path of the mingw folder (libpq.dll and other dll found in a video of postgresql in youtube ) but doesn't work. I started by Mysql and when i saw qpsql*.dll I changed to it but same errors.
@JonB first thank you very much for your help and time , second yeah naturally i google it before , this is my first time posting a question in a forum, all times i google, but this one ! -
wrote on 23 Sept 2020, 19:17 last edited by
libpq.dll is for connecting to a Postgresql database not a Mysql database (not sure why you mentioned MySql in your most recent reply). Also, these dlls will also have to be 32-bit since your application is 32-bit.
-
libpq.dll is for connecting to a Postgresql database not a Mysql database (not sure why you mentioned MySql in your most recent reply). Also, these dlls will also have to be 32-bit since your application is 32-bit.
-
wrote on 23 Sept 2020, 20:04 last edited by
Where did you get the libpq and related dlls? You should copy them to the same folder as your project's executable (looks like build-sqlbrowser-Desktop_Qt_15_1_MinGW_32_bit-Debug) or add whatever folder they are in to your PATH environment variable (and restart QtCreator aftewards).
-
Where did you get the libpq and related dlls? You should copy them to the same folder as your project's executable (looks like build-sqlbrowser-Desktop_Qt_15_1_MinGW_32_bit-Debug) or add whatever folder they are in to your PATH environment variable (and restart QtCreator aftewards).
wrote on 23 Sept 2020, 22:59 last edited by@mchinand same problem , no result . I even tried to remake the driver yet an error occured when making :
g++: error: unrecognized command line option '-std=c++1z' g++: error: unrecognized command line option '-Wshift-overflow=2' g++: error: unrecognized command line option '-Wduplicated-cond' mingw32-make[2]: *** [Makefile.Release:403: .obj/release/qsql_sqlite.o] Error 1 mingw32-make[2]: Leaving directory 'C:/Qt/QT5/5.15.1/Src/qtbase/src/plugins/sqldrivers/sqlite' mingw32-make[1]: *** [Makefile:45: release] Error 2 mingw32-make[1]: Leaving directory 'C:/Qt/QT5/5.15.1/Src/qtbase/src/plugins/sqldrivers/sqlite' mingw32-make: *** [Makefile:50: sub-sqlite-make_first] Error 2
-
wrote on 24 Sept 2020, 00:33 last edited by
Hi Again , I solved the problem :: i had to remake the driver and after googling and looking in the forum many guys had the same problem with the actual driver and remaking new one. Here is how to do :
- I'm using Postgresql 10.
1. you need to download the zip file of postgresql where source code exist. 2. lunch the Qt Mingw console. 3. copy all the file exists in the include path of the download zip in %Path_TO_QT\src\qtbase\plugins\sqldrivers\psql ( if you don't you'll have problems with include files .h in mingw32-make 4. make sur to copy the lib files to the same folder psql ( libpq.dll , libeay32.dll, libintl , libiconv, ssleay32.dll ) ssleay32 you can have i from the net ( i got it from my xampp folder) 5. edit the file psql.pro and comment : QMAKE_USE += psql with a # if you don't you'll have error : psql model not defined 6. run the qmake command as follow: qmake "INCLUDEPATH+=PATH_TO_DOWNLOAD_SOURCE\pgsql\include" "LIBS+=PATH_TO_DOWNLOADED_SOURCE\pgsql\lib" psql.pro here PATH_TO_DOWNLOAD_SOURCE mean the path to the download zip extracted 7. run mingw32-make 8. run mingw32-make install
Congrats.
@Christian-Ehrlicher @JonB @mchinand thanks for your time and help :)
18/19