Qt MySQL -------- 无法打开包含文件:'mysql.h': [英] Qt MySQL -------- Cannot open include file: 'mysql.h':
问题描述
我正在用 Qt 制作一个 GUI 应用程序,它基本上是数据库的前端
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)
无论如何,我的项目甚至无法构建,因为 Qt 给出了错误:
Anyway my project wont even build because Qt gives the error:
error: C1083: Cannot open include file: 'mysql.h': No such file or directory
我不是特别理解,因为在使用我包含的 QtSQL 内容的类中:
which i dont particularly understand because in the class that uses the QtSQL stuff i have included:
#include <QtSql/QSqlDatabase>
#include <QtSql/QMYSQLDriver>
现在有点把我的头撞在桌子上,因为我从文档中了解到,这两个包含的内容就是你所需要的,哦,这在我的 .pro 中
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?
干杯
推荐答案
您实际上不需要包含 QMYSQLDriver
.您真正需要的是构建 mysql 驱动程序.这是 手册,告诉您如何操作.
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.
这篇关于Qt MySQL -------- 无法打开包含文件:'mysql.h':的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!