I want to create a connection to an existent MySQL Server. I have already tested if have support and I have. Everything is in the right folder. And in case it’s important, I’m using the Qt Creator with Qt 4.7 on Ubuntu. I really hope someone here can help me.
Thank you in anticipation!

Here’s my code:
Qt Code:
  1. #include <QtGui/QApplication>
  2. #include <QtSql/QSqlDatabase>
  3. #include <QtSql/QMYSQLDriver>
  4. #include <QtSql/QtSql>
  5. #include <QMessageBox>
  6.  
  7. bool createConnection(){ QSqlDatabase db = QSqlDatabase::addDatabase(“QMYSQL”);
  8. db.setHostName(“edu.uni-ulm.de”);
  9. db.setDatabaseName(“config”);
  10. db.setPort(1234);
  11. db.setUserName(“gbatstone”);
  12. db.setPassword(“Hiddsg44”);
  13. if (!db.open()){
  14. QMessageBox::critical(0, QObject::tr(“Database Error”), db.lastError().text());
  15. return false;
  16. }
  17. return true; }
  18.  
  19. int main(int argc, char *argv[])
  20. { QApplication a(argc, argv);
  21. if (!createConnection()) return 1;
  22. return a.exec();
  23. }
To copy to clipboard, switch view to plain text mode 

The .pro file:
Qt Code:
  1. QT += core gui
  2. QT += sql
  3. TARGET = Test
  4. TEMPLATE = app
  5. SOURCES += main.cpp
  6. HEADERS += ../../../../../../usr/include/qt4/QtSql/qsql_mysql.h \ ../../../../../../usr/include/mysql/mysql.h
  7. INCLUDEPATH += “/usr/include/mysql/” \ “/usr/include/qt4/QtSql/”
  8. LIBS+=”-L/usr/lib/mysql”
To copy to clipboard, switch view to plain text mode 
And the complete error message:
/home/melanie/Desktop/Workspace/Qt Test/Test-build-desktop/moc_qsql_mysql.cpp:73: error: undefined reference to `QMYSQLDriver::isIdentifierEscapedImplementation(Q String const&, QSqlDriver::IdentifierType) const’