Qt编译mysql需要修改的qmake

//mysql.pro
TARGET = qsqlmysql

HEADERS += $$PWD/qsql_mysql_p.h
SOURCES += $$PWD/qsql_mysql.cpp $$PWD/main.cpp

#QMAKE_USE += mysql

OTHER_FILES += mysql.json

INCLUDEPATH += E:\mysql-5.7.38-winx64\include
DEPENDPATH += E:\mysql-5.7.38-winx64\include
LIBS += -LE:\mysql-5.7.38-winx64\lib -llibmysql

PLUGIN_CLASS_NAME = QMYSQLDriverPlugin
include(../qsqldriverbase.pri)
//qsqldriverbase.pri
QT  = core core-private sql-private

# For QMAKE_USE in the parent projects.
#include($$shadowed($$PWD)/qtsqldrivers-config.pri)

PLUGIN_TYPE = sqldrivers
load(qt_plugin)

DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII

你可能感兴趣的:(1024程序员节)