QSqlDatabase: QPSQL driver not loaded once again!
-
@raven-worx
May you please read my first post carefully :) I already put libpq.dll beside my app (option 2).Any way I tried your 3rd suggestion but I still get same result :(
For 1st option I'm unable to find qpsql.dll any place in Qt binaries installation!
-
For 1st option I'm unable to find qpsql.dll any place in Qt binaries installation!
For example should be in C:\Qt\5.6\msvc2015\plugins\sqldrivers
But to make sure, you can check where the application loads the plugins by setting the QT_DEBUG_PLUGINS to a non-zero value and look out for the psql plugin.
-
@raven-worx
May you please read the check of QT_DEBUG_PLUGINS
https://gist.github.com/mbnoimi/154b31a77a079c45bbdd63d4c1cfe3bc -
@mbnoimi
the problem is this lineQLibraryPrivate::loadPlugin failed on "C:/Qt/Qt5.7.0/5.7/mingw53_32/plugins/sqldrivers/qsqlpsqld.dll" : "Cannot load library C:\\Qt\\Qt5.7.0\\5.7\\mingw53_32\\plugins\\sqldrivers\\qsqlpsqld.dll: %1 is not a valid Win32 application."
seems to be an psql specific error
-
Thanks @raven-worx I did I mentioned in Stackoverflow link but unfortunately I still get same result.
NOTE: I update the log of QT_DEBUG_PLUGINS output:
https://gist.github.com/mbnoimi/154b31a77a079c45bbdd63d4c1cfe3bc -
@mbnoimi
so something is wrong with your psql binaries.Maybe a mismatch between x86 and x64?
-
Maybe a mismatch between x86 and x64?
To be of mismatching between x86 and x64 I did:
- Uninstalled postgres-9.3.4-4-windows-x64
- installed postgres-9.3.13-windows
- Copied runtime of postgres-9.3.13-windows beside my Qt app
I get same error message!!!
Now I'm pretty sure this problem is related to Qt SQL plugin so I'll try to build it by myself (I'll send the result after finish it)
-
Hi,
Did you check that you have a MinGW build of PostgreSQL ?
-
@mbnoimi said:
Now I'm pretty sure this problem is related to Qt SQL plugin so I'll try to build it by myself (I'll send the result after finish it)
I don't know what makes you think that but try it if you want to.
What is the content of your PATH env variable? Is there a reference to the psql install dir?
-
Hence your problem: you are currently using the MinGW build of Qt, so unless you have a MinGW version of PostgreSQL your only option is to use a MSVC build of Qt matching the version used by PostgreSQL.
In any case, the PostgreSQL folks have provided a wiki page about MinGW here.
Hope it helps
-
@SGaist
that makes sense of course.
One would expect that the Postgresql devs would export the symbols using "C-style" to avoid such problems?! -
Thank you very much @SGaist and @raven-worx for helping me out. I fixed this issue by using runtime libraries from this project:
https://sourceforge.net/projects/postgresql-mingw-w64/