I am running Ubuntu 14.04 (Trusty Tahr). I have installed Qt from the package qt-sdk
. I have also installed the following package which should have installed the PostgreSQL driver:
libqt5sql5-psql
My Qt version is:
Qt Creator 3.0.1 based on Qt 5.2.1
When I try to create a Qt db object of type postgres like so:
QSqlDatabase db = QSqlDatabase::addDatabase(“QPSQL”);
I get a lot of errors like so:
/home/bc/projects/qt_test/main.cpp:12: error: stray '\342' in program
QSqlDatabase db = QSqlDatabase::addDatabase(“QPSQL”);
^
/home/bc/projects/qt_test/main.cpp:12: error: 'QPSQL' was not declared in this scope
QSqlDatabase db = QSqlDatabase::addDatabase(“QPSQL”);
I am obviously not doing something correctly. I don't know what though. Perhaps I am missing a package, or I have misconfigured something.
How can I fix it?