Qt и PostgreSQL



Вообщем распаковал исходники Qt, зашел в плагин pgsql, сделал qmake "INCLUDEPATH+=/usr/local/pgsql/include" "LIBS+=-L/usr/local/pgsql/lib -lpq"
make install
install -m 755 -p "" "/usr/lib/qt/plugins/sqldrivers/"
strip --strip-unneeded "/usr/lib/qt/plugins/sqldrivers/"

при попытке запустить откомпиленный проект. ругается
QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL3 QMYSQL

Пути: QT_PLUGIN_PATH=/root/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/:/usr/lib/qt/ plugins/sqldrivers:/usr/local/pgsql/lib

#include <QtDebug>
#include <QtGui>
#include <QSqlDatabase>
#include <QSqlQueryModel>
#include <QSqlError>


You should always use client libraries that have been compiled with the same compiler as you are using for your project. If you cannot get a source distibution to compile the client libraries yourself, you must make sure that the pre-compiled library is compatible with your compiler, otherwise you will get a lot of "undefined symbols" errors. Some compilers have tools to convert libraries, e.g. Borland ships the tool COFF2OMF.EXE to convert libraries that have been generated with Microsoft Visual C++.

If the compilation of a plugin succeeds but it cannot be loaded, make sure that the following requirements are met:

Ensure that you are using a shared Qt library; you cannot use the plugins with a static build. Ensure that the plugin is in the correct directory. You can use QApplication::libraryPaths() to determine where Qt looks for plugins. Ensure that the client libraries of the DBMS are available on the system. On Unix, run the command ldd and pass the name of the plugin as parameter, for example ldd You will get a warning if any of the client libraries couldn't be found. On Windows, you can use Visual Studio's dependency walker. Compile Qt with QT_DEBUG_COMPONENT defined to get very verbose debug output when loading plugins.

Ответ на: комментарий от shutty

ldd /usr/lib/qt/plugins/sqldrivers/ =>(0xffffe000)>notfound => /usr/lib/qt/lib/ (0xb7e76000)
Прописал путь в /etc/
сделал ldconfig
При запуске программы та же ошибка.

splinter ★★★★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.