Frage

Im making a GUI application in Qt, it will be a front end to a database basically

however i haven't even got to the point of doing anything yet because my database connection just keeps failing (Well it doesn't actually compile so its not a DB connection issue)

Anyway my project wont even build because Qt gives the error:

 error: C1083: Cannot open include file: 'mysql.h': No such file or directory

which i dont particularly understand because in the class that uses the QtSQL stuff i have included:

#include <QtSql/QSqlDatabase>
#include <QtSql/QMYSQLDriver>

kind of banging my head against the desk now because it is my understanding from the documentation that these 2 includes are all you need, oh and this in my .pro

QT       += sql

am i missing something really obvious here?

cheers

War es hilfreich?

Lösung

You actually don't need to include QMYSQLDriver. What you really need is to build mysql driver. Here is the manual, which tells you how to do it.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top