문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top