It want to familiarize myself with Qt by building a simple console application that can access a SQLite database. Using http://doc.qt.nokia.com/4.7/sql-connecting.html as a reference, I enter this in Qt Creator:

Qt Code:
  1. #include <QtSql/QSqlDatabase>
  2.  
  3. int main() {
  4.  
  5. QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
  6.  
  7. }
To copy to clipboard, switch view to plain text mode 

When I try to build, I get a number of errors similar to: "/(...)/console-1/main.cpp:-1: error: undefined reference to `QSqlDatabase::defaultConnection".

What is wrong?