Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Error trying to build Qt SQL drivers
Forum Update on Monday, May 27th 2025

Error trying to build Qt SQL drivers

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 514 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    patelvrajn
    wrote on 8 Apr 2019, 00:17 last edited by patelvrajn 4 Aug 2019, 00:19
    #1

    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.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Apr 2019, 21:28 last edited by
      #2

      Hi,

      What exact instructions did you follow ?

      The ones from the documentation ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      2/2

      8 Apr 2019, 21:28

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved