Question

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

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top