标签:TBase mysq plugin include span head ade class tor
1、环境 Qt5.15 + mysql-5.7.26
Qt源码路径
C:\Qt\5.15.0\Src\qtbase\src\plugins\sqldrivers\mysql
mysql-5.7.26安装路径
C:\Program Files (x86)\mysql-5.7.26-win32
2、使用Qtcreator打开mysql驱动工程,并做以下修改
TARGET = qsqlmysql HEADERS += $$PWD/qsql_mysql_p.h SOURCES += $$PWD/qsql_mysql.cpp $$PWD/main.cpp #QMAKE_USE += mysql OTHER_FILES += mysql.json INCLUDEPATH +="C:\Program Files (x86)\mysql-5.7.26-win32\include" LIBS +="C:\Program Files (x86)\mysql-5.7.26-win32\lib\libmysql.lib" PLUGIN_CLASS_NAME = QMYSQLDriverPlugin include(../qsqldriverbase.pri)
3、编译即可,文件生成在C盘根目录,复制到相应的编译器目录即可
标签:TBase mysq plugin include span head ade class tor
原文地址:https://www.cnblogs.com/hiwjy/p/14873275.html