Qt MySQL -----— Cannot open include file: 'mysql.h':

心已入冬 提交于 2021-01-28 10:17:29

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/15930894/qt-mysql-cannot-open-include-file-mysql-h

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!