Did you compile the release and debug versions of the plugin? The output of the dependency walker looks like you work with the debug version. You should have qsqlpsql4.dll and qsqlpsqld4.dll in the %QTDIR%pluginssqldrivers directory. You can check the plugin path that is used in your program with: QString QLibraryInfo::location ( QLibraryInfo::PluginsPath );
i compiled both qsqlpsql4.dll/qsqlpsqld4.dll and plugin path is correct(%QTDIR%plugins). Thank for the answer. – bmeric29 дек. 102010-12-29 20:02:45
Feb 27, 2014 QSqlDatabase: QPSQL driver not loaded #76. Closed far-jmp opened this issue Feb 28, 2014 1 comment Closed QSqlDatabase: QPSQL driver not loaded #76. Jun 28, 2016 QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7 'Driver not loaded Driver not loaded' Although I followed all Qt deployment steps! OS: Windows 7 x64; Qt: 5.7; Postgres: 9.3.4-4-windows-x64; See files structure please. I want to load qt5 psql driver in windows 7. I've load the library as this way: qDebug QSqlDatabase::addDatabase(driverName,'A connection to postgres'); And the output shows.
Qsqldatabase Qpsql Driver Not Loaded Ubuntu
I want to load qt5 psql driver in windows 7. I've load the library as this way: qDebug QSqlDatabase::addDatabase(driverName,'A connection to postgres'); And the output shows. QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMARIADB QODBC QPSQL Could not create database object While navigating the results in forward-only mode, the handle of QSqlResult may change.
The link you mentioned above also talks about the need to have (%pgsql)bin in your path. – hmuelner29 дек. 102010-12-29 20:08:33
I compiled both release and debug versions, and the plugin path used is correct, yet I am still having the same issue. Any other ideas? – Jordan10 июн. 112011-06-10 12:37:31
Try to use the debug version with VS2008 and have a look at the output window, where all loaded dlls are listed with the full path. Are the paths correct? – hmuelner11 июн. 112011-06-11 16:45:27
Hi all,
I'm getting crazy with QMYSQL :(. I want to connet to a mysql server through this code (for testing the connection only). Qt version is 5.2.1, while OS is Ubuntu 13.10.
@
#include <QCoreApplication>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlError>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
qDebug() << 'Started';
qDebug() << 'library path ' << a.libraryPaths();
}
@
I get the following output:
Started
library path ('/home/fabio/Qt/5.2.1/gcc/plugins', '/home/fabio/Tests/Qt/build-TestDatabase-Desktop_Qt_5_2_1_GCC_32bit-Debug')
('QSQLITE', 'QMYSQL', 'QMYSQL3', 'QPSQL', 'QPSQL7')
available = true
db error= 'Driver not loaded'
driver error= 'Driver not loaded'
done= false
Failed to open database
- db error= 'Driver not loaded'
- driver error= 'Driver not loaded'
Terminating
As you can see, driver is not loaded, even if all libs are at the correct places and dependencies are satisfied.
This is the past of the plugin dependencies
fabio@ubuntu:~$ ldd /home/fabio/Qt/5.2.1/gcc/plugins/sqldrivers/libqsqlmysql.so
linux-gate.so.1 => (0xb77de000)
libmysqlclient.so.18 => /usr/lib/i386-linux-gnu/libmysqlclient.so.18 (0xb7492000)
libQt5Sql.so.5 => /home/fabio/Qt/5.2.1/gcc/lib/libQt5Sql.so.5 (0xb7453000)
libQt5Core.so.5 => /home/fabio/Qt/5.2.1/gcc/lib/libQt5Core.so.5 (0xb6f89000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb6ea0000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb6cec000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb6cd2000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb6ccd000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb6cb1000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb6c6e000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb6c51000)
libicui18n.so.51 => /home/fabio/Qt/5.2.1/gcc/lib/libicui18n.so.51 (0xb6a2f000)
libicuuc.so.51 => /home/fabio/Qt/5.2.1/gcc/lib/libicuuc.so.51 (0xb68b6000)
libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0xb68b2000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb68a9000)
libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb67a5000)
/lib/ld-linux.so.2 (0xb77df000)
libicudata.so.51 => /home/fabio/Qt/5.2.1/gcc/lib/libicudata.so.51 (0xb525c000)
libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb521a000)
and, in the turn, the pasting of libmysqlclient which the plugin depends on:
fabio@ubuntu:~$ ldd /usr/lib/i386-linux-gnu/libmysqlclient.so.18
linux-gate.so.1 => (0xb773a000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb73e6000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb73e1000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb73c5000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb7382000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb7365000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb71b1000)
/lib/ld-linux.so.2 (0xb773b000)
To be more precise, I have built the plugin directly from source code (5.2.1) and the database mentioned in the code really exists on 127.0.0.1.
Qsqldatabase Qpsql Driver Not Loaded Error
I also tried with QMYSQL3 (same result).
I really don't know what else to check.
Please help me
Thanks in advance
Fabio