I am trying to load psql on qt without success. My code:
QApplication a(argc, argv);
QSqlDatabase::addDatabase("QPSQL");
MainWindow w;
w.show();
return a.exec();
I have QT_DEBUG_PLUGINS enabled. Output is:
"The plugin 'C:/Qt/5.1.1/mingw48_32/plugins/sqldrivers/qsqlpsql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" not a plugin QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.1.1/mingw48_32/plugins/sqldrivers/qsqlpsqld.dll" Got keys from plugin meta data ("QPSQL7", "QPSQL") QFactoryLoader::QFactoryLoader() checking directory path "C:/build-Hello-Desktop_Qt_5_1_1_MinGW_32bit-Debug/debug/sqldrivers" ... loaded library "C:/Qt/5.1.1/mingw48_32/plugins/sqldrivers/qsqlpsqld.dll" QLibraryPrivate::loadPlugin failed on "C:/Qt/5.1.1/mingw48_32/plugins/sqldrivers/qsqlpsqld.dll" : "Cannot load library C:/Qt/5.1.1/mingw48_32/plugins/sqldrivers/qsqlpsqld.dll: The specified module could not be found." QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7
My configuration:
- Windows 7 Enterprise
- Qt Creator 2.8.1
- Qt 5.1.1
- Postgre 9.2
- C:\PostgreSQL\9.2\bin; C:\PostgreSQL\9.2\lib added to PATH
I have run dependency walker for the libpg.dll. Two missing dependencies:
- GPSVC.DLL
 - IESHIMS.DLL
 
It seems that after these steps my effort is going to less organised "just-try-something...".