Unsolved QPSQL Driver Not found (Qt 5.5.1 & PostgreSQL 9.5)
-
Sorry did not check Qt is 32 bit and I installed the 64 bit versions of DB Servers.
-
Installed the 32bit-PostgresSQL. I still have the same problem. I am following an earlier postlink text to solve this. Hope it works!
-
One of the important things is to modify your PATH environment variable in Qt Creator in order for your application to find the PostgreSQL DLLs and thus allow the plugin to be loaded.
-
@SGaist said:
PATH environment variable in Qt Creator
I added the paths:
C:\Qt\5.6\mingw49_32\plugins\sqldrivers;C:\Qt\5.6\Src\qtbase\plugins\sqldrivers;C:\Qt\5.6\Src\qtbase\src\plugins\sqldrivers;
to the PATH variable in the Build Environment. It remains unsaved as it shows itself up in Bold font.
it seems quite basic here but got me stuck.PATH = C:\Qt\5.6\mingw49_32\plugins\sqldrivers;C:\Qt\5.6\Src\qtbase\plugins\sqldrivers;C:\Qt\5.6\Src\qtbase\src\plugins\sqldrivers; :${PATH}
Something I miss here, as it won't append. Please help me out. -
Got this Errror:
Got keys from plugin meta data ("svg", "svgz", "svg.gz")
QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Examples/Qt-5.6/qtbase/sql/build-sqlbrowser-Desktop_Qt_5_6_0_MinGW_32bit-Debug/debug/iconengines" ...
QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/5.6/mingw49_32/plugins/accessible" ...
QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Examples/Qt-5.6/qtbase/sql/build-sqlbrowser-Desktop_Qt_5_6_0_MinGW_32bit-Debug/debug/accessible" ...
QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/5.6/mingw49_32/plugins/accessiblebridge" ...
QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Examples/Qt-5.6/qtbase/sql/build-sqlbrowser-Desktop_Qt_5_6_0_MinGW_32bit-Debug/debug/accessiblebridge" ...
loaded library "C:/Qt/5.6/mingw49_32/plugins/sqldrivers/qsqlpsqld.dll"
QLibraryPrivate::loadPlugin failed on "C:/Qt/5.6/mingw49_32/plugins/sqldrivers/qsqlpsqld.dll" : "Cannot load library C:\Qt\5.6\mingw49_32\plugins\sqldrivers\qsqlpsqld.dll: The specified module could not be found."
QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7-
Ran Dependency Walker on "qsqlpsqld.dll" and the dependencies are as follow:
LIBSTDC++-6.DLL
QTSCORED.DLL
QTSSQLD.DLL
LIBPQ.DLL -
Have added to the PATH "C:/Qt/5.6/mingw49_32/plugins/sqldrivers/" "C:\Qt\5.6\mingw49_32\bin"
-
Have already copied "libpq.dll" in the "C:\Qt\5.6\mingw49_32\bin" folder along with "libeay32.dll", "libintl-8.dll", "libpq.dll" and "ssleay32.dll"
-
-
You don't need to any Qt related path to PATH. By the way, are you doing it in the Build part ? That should go in the Run part.
Also there's no need to copy libpq.dll around, just add the folder that contains it to PATH.
One thing you can do to verify that everything is fine with that .DLL is to run Dependency Walker and add the path to the libqp.dll folder in the search path list. It should show you if there's something wrong with it.
-
When I go to the run part it shows that Base environment for this run configuration = the build environment.
The path to "LIBPQ.DLL" already exists here.**add the path to the libqp.dll folder in the search path list
**Can you elaborate this? If you say this is done in Dependency Walker then I can't find the search path list to add the path.
I already ran Dependency Walker on "qsqlpsqld.dll" and found 4 dependencies. -
Right, I forgot that by default the build environment is copied including your customizations.
In Dependency Walker, there's a menu (I don't remember its name right now) that allows you to customize the list of paths search for dependencies of what you are currently analyzing. There you can add the path to PostgreSQL .dll files.
-
There is something called as Module Search Order. I am not sure if this is the one you point to. Since I am not sure, I would like to try it later. Thank you so much for your response and help so far. Truly appreciate it!
-
Yes, that's that one.