Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Error trying to build Qt SQL drivers



  • This is the error I am getting when trying to build the project for the Qt SQL drivers which are located at C:\Qt\5.12.1\Src\qtbase\src\plugins\sqldrivers\mysql for my environment:

    Cannot read C:/Qt/5.12.1/Src/qtbase/src/plugins/sqldrivers/qtsqldrivers-config.pri: No such file or directory
    Project ERROR: Library 'mysql' is not defined.

    When trying to look for this file in the directory it stated, I found that it doesn't exist:

    0_1554682498531_528064cf-e731-4d08-93ee-92563618b078-image.png

    The following is the project file for the drivers that I have modified as per instruction to include the INCLUDEPATH, QMAKE_LIBDIR, and LIBS for the MySQL library and include files:

    TARGET = qsqlmysql
    
    HEADERS += $$PWD/qsql_mysql_p.h
    SOURCES += $$PWD/qsql_mysql.cpp $$PWD/main.cpp
    
    QMAKE_USE += mysql
    
    OTHER_FILES += mysql.json
    
    PLUGIN_CLASS_NAME = QMYSQLDriverPlugin
    
    INCLUDEPATH+="C:/PROGRA~1/MySQL/MySQL Server 8.0/include"
    QMAKE_LIBDIR+="C:/PROGRA~1/MySQL/MySQL Server 8.0/lib"
    LIBS += -L"C:/PROGRA~1/MySQL/MySQL Server 8.0/lib" -lmysql
    
    include(../qsqldriverbase.pri)
    
    

    This is my first time trying to install the Qt SQL drivers, is there a step I missed or screwed up? Can anyone suggest a solution? Thank you in advance for any help.


  • Lifetime Qt Champion

    Hi,

    What exact instructions did you follow ?

    The ones from the documentation ?


Log in to reply