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

Windows 10, QMYSQL driver not loaded, MySQL 8.0



  • Hello,
    I'm brand new to Qt and MySQL. I'm working on learning both. I have seen many posts regarding this, but I have had issues following many of the steps. I have the following error:

    QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/austin.pearce/Documents/build-TechnicianScheduler-Desktop_Qt_5_11_2_MinGW_32bit-Debug/debug/sqldrivers" ...
    Cannot load library C:\Qt\5.11.2\mingw53_32\plugins\sqldrivers\qsqlmysqld.dll: Unknown error 0x000000c1.
    QLibraryPrivate::loadPlugin failed on "C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlmysqld.dll" : "Cannot load library C:\Qt\5.11.2\mingw53_32\plugins\sqldrivers\qsqlmysqld.dll: Unknown error 0x000000c1."
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7

    Windows 10
    Qt Creator installed with the online open source installer for windows
    MySQL 8.0 community edition

    Please help!


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What do you get if your run your application with the QT_DEBUG_PLUGINS environment variable set to 1 ?



  • Thank you for your response!

    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlite.dll"
    Found metadata in lib C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlite.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QSQLITE"
            ]
        },
        "className": "QSQLiteDriverPlugin",
        "debug": false,
        "version": 330498
    }
    
    
    "The plugin 'C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlite.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlited.dll"
    Found metadata in lib C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlited.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QSQLITE"
            ]
        },
        "className": "QSQLiteDriverPlugin",
        "debug": true,
        "version": 330498
    }
    
    
    Got keys from plugin meta data ("QSQLITE")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlmysql.dll"
    Found metadata in lib C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlmysql.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QMYSQL3",
                "QMYSQL"
            ]
        },
        "className": "QMYSQLDriverPlugin",
        "debug": false,
        "version": 330498
    }
    
    
    "The plugin 'C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlmysql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlmysqld.dll"
    Found metadata in lib C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlmysqld.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QMYSQL3",
                "QMYSQL"
            ]
        },
        "className": "QMYSQLDriverPlugin",
        "debug": true,
        "version": 330498
    }
    
    
    Got keys from plugin meta data ("QMYSQL3", "QMYSQL")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlodbc.dll"
    Found metadata in lib C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlodbc.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QODBC3",
                "QODBC"
            ]
        },
        "className": "QODBCDriverPlugin",
        "debug": false,
        "version": 330498
    }
    
    
    "The plugin 'C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlodbc.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlodbcd.dll"
    Found metadata in lib C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlodbcd.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QODBC3",
                "QODBC"
            ]
        },
        "className": "QODBCDriverPlugin",
        "debug": true,
        "version": 330498
    }
    
    
    Got keys from plugin meta data ("QODBC3", "QODBC")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlpsql.dll"
    Found metadata in lib C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlpsql.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QPSQL7",
                "QPSQL"
            ]
        },
        "className": "QPSQLDriverPlugin",
        "debug": false,
        "version": 330498
    }
    
    
    "The plugin 'C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlpsql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlpsqld.dll"
    Found metadata in lib C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlpsqld.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QPSQL7",
                "QPSQL"
            ]
        },
        "className": "QPSQLDriverPlugin",
        "debug": true,
        "version": 330498
    }
    
    
    Got keys from plugin meta data ("QPSQL7", "QPSQL")
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/austin.pearce/Documents/build-TechnicianScheduler-Desktop_Qt_5_11_2_MinGW_32bit-Debug/debug/sqldrivers" ...
    Cannot load library C:\Qt\5.11.2\mingw53_32\plugins\sqldrivers\qsqlmysqld.dll: Unknown error 0x000000c1.
    QLibraryPrivate::loadPlugin failed on "C:/Qt/5.11.2/mingw53_32/plugins/sqldrivers/qsqlmysqld.dll" : "Cannot load library C:\\Qt\\5.11.2\\mingw53_32\\plugins\\sqldrivers\\qsqlmysqld.dll: Unknown error 0x000000c1."
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
    

    Is this what you are looking for?


  • Lifetime Qt Champion

    For some additional information if anything was added.

    Are you sure the version of MySQL you installed is built for MinGW ?

    One other thing, MySQL 8 might be too recent for Qt 5.11. IIRC, they replaced a custom boolean type they used by the boolean type so it might also be that.



  • I am not sure the version of MySQL was built for MinGW. How can I check that?

    What version of MySQL would you recommend? -I just uninstalled MySQL 8.0 and installed MySQL 5.5



  • UPDATE: I have installed MySQL 5.5 and the MySQL Connector C 6.1.

    MySQL is not detected.

    C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR="c:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" MYSQL_LIBDIR="C:\Program Files (x86)\mySQL\MySQL Connector C 6.1\lib"
    
    Running configuration tests...
    Done running configuration tests.
    
    Configure summary:
    
    Qt Sql:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    
    Qt is now configured for building. Just run 'mingw32-make'.
    Once everything is built, Qt is installed.
    You should NOT run 'mingw32-make install'.
    Note that this build cannot be deployed to other machines or devices.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

  • Lifetime Qt Champion

    You should rather install that in a patch without spaces as they are usually trouble.



  • I used paths without spaces with the same result. MySQL not detected. When I try to follow C:\PROGRA~2\MySQL\MYSQLC~1.1\lib\optthe path does not exist, but the path C:\PROGRA~2\MySQL\MYSQLC~1.1\lib\ does exist. Where am I going wrong?

    C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR=C:\PROGRA~2\MySQL\MYSQLC~1.1\include MYSQL_LIBDIR="C:\PROGRA~2\MySQL\MYSQLC~1.1\lib\"
    
    Running configuration tests...
    Done running configuration tests.
    
    Configure summary:
    
    Qt Sql:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    
    Qt is now configured for building. Just run 'mingw32-make'.
    Once everything is built, Qt is installed.
    You should NOT run 'mingw32-make install'.
    Note that this build cannot be deployed to other machines or devices.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

  • Lifetime Qt Champion

    Use the -v option to see exactly where it fails the tests for MySQL.



  • Thank you for your continued help!

    Here is the output from qmake with -v. None of the sources succeed.

    C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers>qmake -- -v MYSQL_INCDIR=C:\PROGRA~2\MySQL\MYSQLC~1.1\include MYSQL_LIBDIR=C:\PROGRA~2\MySQL\MYSQLC~1.1\lib
    Command line: -v "MYSQL_INCDIR=C:\PROGRA~2\MySQL\MYSQLC~1.1\include" "MYSQL_LIBDIR=C:\PROGRA~2\MySQL\MYSQLC~1.1\lib"
    
    Running configuration tests...
    
    Trying source 0 (type inline) of library db2 ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\db2 && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -ldb2cli" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/db2
    > Info: creating stash file C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\.qmake.stash
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\db2 && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:20: fatal error: sqlcli.h: No such file or directory
    > compilation terminated.
    > Makefile:445: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    Trying source 1 (type inline) of library db2 ...
      => source failed condition '!config.win32'.
    
    Trying source 0 (type inline) of library ibase ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\ibase && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lgds32_ms" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/ibase
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\ibase && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:19: fatal error: ibase.h: No such file or directory
    > compilation terminated.
    > Makefile:447: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    Trying source 1 (type inline) of library ibase ...
      => source failed condition '!config.win32'.
    
    Trying source 0 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 1 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 2 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 3 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 4 (type inline) of library mysql ...
      => source failed condition '!config.win32'.
    Trying source 5 (type inline) of library mysql ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -LC:/PROGRA~2/MySQL/MYSQLS~1.5/lib/opt -llibmysql" "INCLUDEPATH *= C:/PROGRA~2/MySQL/MYSQLS~1.5/include" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\PROGRA~2\MySQL\MYSQLS~1.5\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > g++ -Wl,-s -Wl,-subsystem,console -mthreads -o mysql.exe main.o  -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib -LC:\PROGRA~2\MySQL\MYSQLS~1.5\lib\opt -llibmysql
    > C:/Qt/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -llibmysql
    > collect2.exe: error: ld returned 1 exit status
    > Makefile:64: recipe for target 'mysql.exe' failed
    > mingw32-make: *** [mysql.exe] Error 1
     => source failed verification.
    Trying source 6 (type inline) of library mysql ...
      => source failed condition '!config.win32'.
    
    Trying source 0 (type inline) of library oci ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\oci && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -loci" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/oci
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\oci && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:17: fatal error: oci.h: No such file or directory
    > compilation terminated.
    > Makefile:447: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    Trying source 1 (type inline) of library oci ...
      => source failed condition '!config.win32'.
    
    Trying source 0 (type inline) of library odbc ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lodbc32" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/odbc
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > g++ -Wl,-s -Wl,-subsystem,console -mthreads -o odbc.exe main.o  -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib -lodbc32
     => source accepted.
    
    Trying source 0 (type pkgConfig) of library psql ...
    pkg-config use disabled globally.
      => source produced no result.
    Trying source 1 (type psqlConfig) of library psql ...
    pg_config not found.
      => source produced no result.
    Trying source 2 (type psqlEnv) of library psql ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\psql && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -llibpq -lws2_32 -ladvapi32" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/psql
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\psql && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:22: fatal error: libpq-fe.h: No such file or directory
    > compilation terminated.
    > Makefile:447: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    Trying source 3 (type psqlEnv) of library psql ...
      => source failed condition '!config.win32'.
    
    Trying source 0 (type inline) of library sqlite2 ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\sqlite2 && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lsqlite" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/sqlite2
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\sqlite2 && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:20: fatal error: sqlite.h: No such file or directory
    > compilation terminated.
    > Makefile:447: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    
    Trying source 0 (type sybaseEnv) of library tds ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lNTWDBLIB" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:22: fatal error: sybfront.h: No such file or directory
    > compilation terminated.
    > Makefile:447: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    Trying source 1 (type sybaseEnv) of library tds ...
      => source failed condition '!config.win32'.
    Done running configuration tests.
    
    Configure summary:
    
    Qt Sql:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    
    Qt is now configured for building. Just run 'mingw32-make'.
    Once everything is built, Qt is installed.
    You should NOT run 'mingw32-make install'.
    Note that this build cannot be deployed to other machines or devices.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    
    

  • Lifetime Qt Champion

    Did you start from a clean state ?

    Because I'm seeing include from MySQL 5.6.11



  • How can I ensure that I am starting from a clean state?



  • @SGaist Thank you for your direction.

    Again, I am new to QT and MySQL. I'm not sure why it says MySQL 5.6.11 since I've never had that installed?!

    • I started with MySQL 8.0 but have changed to MySQL Server 5.5 (32 bit)
    • I have downloaded and installed MySQL Connector C 6.1.11
    • I uninstalled Qt and reinstalled. qt-unified-windows-x86-3.0.5-online
    • I used maintenaince tool to remove mingw32 and the Sources and then added them again

    Still no MySQL detected! Is there something I need to do to clean the configuration before I type the command?

    Latest from my command:

    C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers>qmake -- -v MYSQL_INCDIR=C:\PROGRA~2\MySQL\MYSQLC~1.1\include MYSQL_LIBDIR=C:\PROGRA~2\MySQL\MYSQLC~1.1\lib
    Command line: -v "MYSQL_INCDIR=C:\PROGRA~2\MySQL\MYSQLC~1.1\include" "MYSQL_LIBDIR=C:\PROGRA~2\MySQL\MYSQLC~1.1\lib"
    
    Running configuration tests...
    
    Trying source 0 (type inline) of library db2 ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\db2 && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -ldb2cli" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/db2
    > Info: creating stash file C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\.qmake.stash
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\db2 && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:20: fatal error: sqlcli.h: No such file or directory
    > compilation terminated.
    > Makefile:445: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    Trying source 1 (type inline) of library db2 ...
      => source failed condition '!config.win32'.
    
    Trying source 0 (type inline) of library ibase ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\ibase && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lgds32_ms" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/ibase
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\ibase && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:19: fatal error: ibase.h: No such file or directory
    > compilation terminated.
    > Makefile:447: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    Trying source 1 (type inline) of library ibase ...
      => source failed condition '!config.win32'.
    
    Trying source 0 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 1 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 2 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 3 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 4 (type inline) of library mysql ...
      => source failed condition '!config.win32'.
    Trying source 5 (type inline) of library mysql ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -LC:\\PROGRA~2\\MySQL\\MYSQLC~1.1 -llibmysql" "INCLUDEPATH *= C:\\PROGRA~2\\MySQL\\MYSQLC~1.1" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\PROGRA~2\MySQL\MYSQLC~1.1 -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:5:19: fatal error: mysql.h: No such file or directory
    > compilation terminated.
    > Makefile:447: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    Trying source 6 (type inline) of library mysql ...
      => source failed condition '!config.win32'.
    
    Trying source 0 (type inline) of library oci ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\oci && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -loci" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/oci
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\oci && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:17: fatal error: oci.h: No such file or directory
    > compilation terminated.
    > Makefile:447: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    Trying source 1 (type inline) of library oci ...
      => source failed condition '!config.win32'.
    
    Trying source 0 (type inline) of library odbc ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lodbc32" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/odbc
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > g++ -Wl,-s -Wl,-subsystem,console -mthreads -o odbc.exe main.o  -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib -lodbc32
     => source accepted.
    
    Trying source 0 (type pkgConfig) of library psql ...
    pkg-config use disabled globally.
      => source produced no result.
    Trying source 1 (type psqlConfig) of library psql ...
    pg_config not found.
      => source produced no result.
    Trying source 2 (type psqlEnv) of library psql ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\psql && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -llibpq -lws2_32 -ladvapi32" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/psql
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\psql && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:22: fatal error: libpq-fe.h: No such file or directory
    > compilation terminated.
    > Makefile:447: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    Trying source 3 (type psqlEnv) of library psql ...
      => source failed condition '!config.win32'.
    
    Trying source 0 (type inline) of library sqlite2 ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\sqlite2 && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lsqlite" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/sqlite2
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\sqlite2 && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:20: fatal error: sqlite.h: No such file or directory
    > compilation terminated.
    > Makefile:447: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    
    Trying source 0 (type sybaseEnv) of library tds ...
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && C:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lNTWDBLIB" C:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds
    + cd /d C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:22: fatal error: sybfront.h: No such file or directory
    > compilation terminated.
    > Makefile:447: recipe for target 'main.o' failed
    > mingw32-make: *** [main.o] Error 1
     => source failed verification.
    Trying source 1 (type sybaseEnv) of library tds ...
      => source failed condition '!config.win32'.
    Done running configuration tests.
    
    Configure summary:
    
    Qt Sql:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    
    Qt is now configured for building. Just run 'mingw32-make'.
    Once everything is built, Qt is installed.
    You should NOT run 'mingw32-make install'.
    Note that this build cannot be deployed to other machines or devices.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

  • Lifetime Qt Champion

    The most simple: don't build in the sources. Do it in a folder outside of Qt's source tree, so if you have something that's failing you can just nuke the folder and start anew.

    Did you check where sqlcli.h is on your system exactly ?


Log in to reply