QPSQL driver not loaded



  • Hi,
    I installed Qt using the install wizard in home folder. I installed libqt5sql5-psql and postgresql using:
    sudo apt-get install libqt5sql5-psql
    sudo apt-get install postgresql
    Now I try connect Qt to PostgreSql, so I follow by http://qt-project.org/doc/qt-5.0/qtsql/sql-driver.html but it gives me errors:
    @michal@mickey:~/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/sqldrivers/psql$ qmake "INCLUDEPATH+=/usr/include/pgsql" "LIBS+=-L/usr/lib -lpq" psql.pro
    michal@mickey:~/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/sqldrivers/psql$ make
    g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -I/usr/include/postgresql -O2 -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQ_USE_APPMENU -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++ -I. -I/usr/include/pgsql -I/usr/include/qt5 -I/usr/include/qt5/QtSql -I/usr/include/qt5/QtSql/5.0.2 -I/usr/include/qt5/QtSql/5.0.2/QtSql -I/usr/include/qt5/QtCore -I.moc/release-shared -o .obj/release-shared/qsql_psql.o ../../../sql/drivers/psql/qsql_psql.cpp
    ../../../sql/drivers/psql/qsql_psql.cpp:56:40: fatal error: QtSql/private/qsqlresult_p.h: No such file or directory
    compilation terminated.
    make: *** [.obj/release-shared/qsql_psql.o] Error 1
    @
    What can I do with this?
    Thanks for answer ;)



  • It seems that you are trying to build postgre sql driver, but by installing libqt5sql5-psql you should already have this driver. What is output of:
    @
    sudo find / -name libqsqlpsql*
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.