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. QMYSQL driver not loaded and Library mysql is not defined

QMYSQL driver not loaded and Library mysql is not defined

Scheduled Pinned Locked Moved Solved General and Desktop
qmakeqmysqldriver not loadunknown qmake
44 Posts 6 Posters 9.3k 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.
  • M Markyo

    @jsulm Oh ok I understand!
    My visual studio is 2019 version 16.6.2, but if I'm reading well, the highest available here is 2017, should I upgrade Qt to 5.15?

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #27

    @Markyo Visual Studio 2019 C++ compiler is compatible with the one in Visual Studio 2017.
    So, you can install Qt for MSVC2017 64bit.

    M 2 Replies Last reply
    0
    • jsulmJ jsulm

      @Markyo Visual Studio 2019 C++ compiler is compatible with the one in Visual Studio 2017.
      So, you can install Qt for MSVC2017 64bit.

      M Offline
      M Offline
      Markyo
      wrote on last edited by
      #28

      @jsulm ok thanks for precisions, so I unticked all except MSVC 2017 64-bit

      1 Reply Last reply
      1
      • jsulmJ jsulm

        @Markyo Visual Studio 2019 C++ compiler is compatible with the one in Visual Studio 2017.
        So, you can install Qt for MSVC2017 64bit.

        M Offline
        M Offline
        Markyo
        wrote on last edited by
        #29

        @jsulm Ok new Qt has been installed, I ran again the command:

        C:\Qt\5.12.5\msvc2017_64\bin\qmake.exe -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Connector C 6.1\include" MYSQL_LIBDIR="C:\Program Files\MySQL\MySQL Connector C 6.1\lib"
        

        And this time, another one turn to yes, but not MySQL:

        Info: creating stash file C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\.qmake.stash
        
        Running configuration tests...
        Checking for DB2 (IBM)... no
        Checking for InterBase... no
        Checking for MySQL... no
        Checking for OCI (Oracle)... no
        Checking for ODBC... yes
        Checking for PostgreSQL... no
        Checking for SQLite (version 2)... no
        Checking for TDS (Sybase)... no
        Done running configuration tests.
        
        Configure summary:
        
        Qt Sql Drivers:
          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 'nmake'.
        Once everything is built, you must run 'nmake install'.
        Qt will be installed into 'C:\Qt\5.12.5\msvc2017_64'.
        
        Prior to reconfiguration, make sure you remove any leftovers from
        the previous build.
        

        And there is the config.log file:

        Command line: "MYSQL_INCDIR=C:\Program Files\MySQL\MySQL Connector C 6.1\include" "MYSQL_LIBDIR=C:\Program Files\MySQL\MySQL Connector C 6.1\lib"
        Global lib dirs: [C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-winx64\\lib C:\\Utils\\postgresql\\pgsql\\lib] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\ATLMFC\\lib\\x86" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\lib\\x86" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.18362.0\\ucrt\\x86" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.18362.0\\um\\x86"]
        Global inc dirs: [C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-winx64\\include C:\\Utils\\postgresql\\pgsql\\include] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\ATLMFC\\include" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\include" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\ucrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\shared" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\um" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\winrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\cppwinrt"]
        looking for library db2
        Trying source 0 (type inline) of library db2 ...
        None of [db2cli.lib] found in [] and global paths.
          => source produced no result.
        Trying source 1 (type inline) of library db2 ...
          => source failed condition '!config.win32'.
        test config.sqldrivers.libraries.db2 FAILED
        looking for library ibase
        Trying source 0 (type inline) of library ibase ...
        None of [gds32_ms.lib] found in [] and global paths.
          => source produced no result.
        Trying source 1 (type inline) of library ibase ...
          => source failed condition '!config.win32'.
        test config.sqldrivers.libraries.ibase FAILED
        looking for library mysql
        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.12.5\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && C:\Qt\5.12.5\msvc2017_64\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-winx64\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-winx64\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += mysql" "QMAKE_LIBS_MYSQL = \"C:\\Program Files\\MySQL\\MySQL Connector C 6.1\\lib/libmysql.lib\"" "QMAKE_INCDIR_MYSQL = \"C:\\Program Files\\MySQL\\MySQL Connector C 6.1\\include\"" C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql
        > Info: creating stash file C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\config.tests\.qmake.stash
        + cd /d C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && set MAKEFLAGS=& nmake
        > Microsoft (R) Program Maintenance Utility Version 14.26.28806.0
        > Copyright (C) Microsoft Corporation. Tous droits réservés.
        > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DNDEBUG -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-winx64\include -IC:\Utils\postgresql\pgsql\include -I"C:\Program Files\MySQL\MySQL Connector C 6.1\include" -IC:\Qt\5.12.5\msvc2017_64\mkspecs\win32-msvc -Fo @C:\Users\marco\AppData\Local\Temp\nmB781.tmp
        > main.cpp
        > 	link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:mysql.exe @C:\Users\marco\AppData\Local\Temp\nmBA02.tmp
        > main.obj : error LNK2019: symbole externe non r‚solu _mysql_get_client_version@0 r‚f‚renc‚ dans la fonction _main
        > C:\Program Files\MySQL\MySQL Connector C 6.1\lib\libmysql.lib : warning LNK4272: type d'ordinateur bibliothŠque 'x64' en conflit avec le type d'ordinateur cible 'x86'
        > mysql.exe : fatal error LNK1120: 1 externes non r‚solus
        > NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\link.EXE"' : code retour '0x460'
        > Stop.
         => source failed verification.
        Trying source 6 (type inline) of library mysql ...
          => source failed condition '!config.win32'.
        test config.sqldrivers.libraries.mysql FAILED
        looking for library oci
        Trying source 0 (type inline) of library oci ...
        None of [oci.lib] found in [] and global paths.
          => source produced no result.
        Trying source 1 (type inline) of library oci ...
          => source failed condition '!config.win32'.
        test config.sqldrivers.libraries.oci FAILED
        looking for library odbc
        Trying source 0 (type inline) of library odbc ...
        + cd /d C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && C:\Qt\5.12.5\msvc2017_64\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-winx64\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-winx64\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += odbc" "QMAKE_LIBS_ODBC = \"C:\\Program Files ^(x86^)\\Windows Kits\\10\\lib\\10.0.18362.0\\um\\x86/odbc32.lib\"" C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/config.tests/odbc
        + cd /d C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && set MAKEFLAGS=& nmake
        > Microsoft (R) Program Maintenance Utility Version 14.26.28806.0
        > Copyright (C) Microsoft Corporation. Tous droits réservés.
        > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DNDEBUG -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-winx64\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.12.5\msvc2017_64\mkspecs\win32-msvc -Fo @C:\Users\marco\AppData\Local\Temp\nmBB78.tmp
        > main.cpp
        > 	link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:odbc.exe @C:\Users\marco\AppData\Local\Temp\nmBD4E.tmp
         => source accepted.
        test config.sqldrivers.libraries.odbc succeeded
        looking for library psql
        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 ...
        None of [libpq.lib] found in [] and global paths.
          => source produced no result.
        Trying source 3 (type psqlEnv) of library psql ...
          => source failed condition '!config.win32'.
        test config.sqldrivers.libraries.psql FAILED
        looking for library sqlite2
        Trying source 0 (type inline) of library sqlite2 ...
        None of [sqlite.lib] found in [] and global paths.
          => source produced no result.
        test config.sqldrivers.libraries.sqlite2 FAILED
        looking for library tds
        Trying source 0 (type sybaseEnv) of library tds ...
        None of [NTWDBLIB.lib] found in [] and global paths.
          => source produced no result.
        Trying source 1 (type sybaseEnv) of library tds ...
          => source failed condition '!config.win32'.
        test config.sqldrivers.libraries.tds FAILED
        
        jsulmJ 1 Reply Last reply
        0
        • M Markyo

          @jsulm Ok new Qt has been installed, I ran again the command:

          C:\Qt\5.12.5\msvc2017_64\bin\qmake.exe -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Connector C 6.1\include" MYSQL_LIBDIR="C:\Program Files\MySQL\MySQL Connector C 6.1\lib"
          

          And this time, another one turn to yes, but not MySQL:

          Info: creating stash file C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\.qmake.stash
          
          Running configuration tests...
          Checking for DB2 (IBM)... no
          Checking for InterBase... no
          Checking for MySQL... no
          Checking for OCI (Oracle)... no
          Checking for ODBC... yes
          Checking for PostgreSQL... no
          Checking for SQLite (version 2)... no
          Checking for TDS (Sybase)... no
          Done running configuration tests.
          
          Configure summary:
          
          Qt Sql Drivers:
            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 'nmake'.
          Once everything is built, you must run 'nmake install'.
          Qt will be installed into 'C:\Qt\5.12.5\msvc2017_64'.
          
          Prior to reconfiguration, make sure you remove any leftovers from
          the previous build.
          

          And there is the config.log file:

          Command line: "MYSQL_INCDIR=C:\Program Files\MySQL\MySQL Connector C 6.1\include" "MYSQL_LIBDIR=C:\Program Files\MySQL\MySQL Connector C 6.1\lib"
          Global lib dirs: [C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-winx64\\lib C:\\Utils\\postgresql\\pgsql\\lib] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\ATLMFC\\lib\\x86" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\lib\\x86" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.18362.0\\ucrt\\x86" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.18362.0\\um\\x86"]
          Global inc dirs: [C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-winx64\\include C:\\Utils\\postgresql\\pgsql\\include] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\ATLMFC\\include" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\include" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\ucrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\shared" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\um" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\winrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\cppwinrt"]
          looking for library db2
          Trying source 0 (type inline) of library db2 ...
          None of [db2cli.lib] found in [] and global paths.
            => source produced no result.
          Trying source 1 (type inline) of library db2 ...
            => source failed condition '!config.win32'.
          test config.sqldrivers.libraries.db2 FAILED
          looking for library ibase
          Trying source 0 (type inline) of library ibase ...
          None of [gds32_ms.lib] found in [] and global paths.
            => source produced no result.
          Trying source 1 (type inline) of library ibase ...
            => source failed condition '!config.win32'.
          test config.sqldrivers.libraries.ibase FAILED
          looking for library mysql
          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.12.5\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && C:\Qt\5.12.5\msvc2017_64\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-winx64\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-winx64\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += mysql" "QMAKE_LIBS_MYSQL = \"C:\\Program Files\\MySQL\\MySQL Connector C 6.1\\lib/libmysql.lib\"" "QMAKE_INCDIR_MYSQL = \"C:\\Program Files\\MySQL\\MySQL Connector C 6.1\\include\"" C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql
          > Info: creating stash file C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\config.tests\.qmake.stash
          + cd /d C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && set MAKEFLAGS=& nmake
          > Microsoft (R) Program Maintenance Utility Version 14.26.28806.0
          > Copyright (C) Microsoft Corporation. Tous droits réservés.
          > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DNDEBUG -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-winx64\include -IC:\Utils\postgresql\pgsql\include -I"C:\Program Files\MySQL\MySQL Connector C 6.1\include" -IC:\Qt\5.12.5\msvc2017_64\mkspecs\win32-msvc -Fo @C:\Users\marco\AppData\Local\Temp\nmB781.tmp
          > main.cpp
          > 	link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:mysql.exe @C:\Users\marco\AppData\Local\Temp\nmBA02.tmp
          > main.obj : error LNK2019: symbole externe non r‚solu _mysql_get_client_version@0 r‚f‚renc‚ dans la fonction _main
          > C:\Program Files\MySQL\MySQL Connector C 6.1\lib\libmysql.lib : warning LNK4272: type d'ordinateur bibliothŠque 'x64' en conflit avec le type d'ordinateur cible 'x86'
          > mysql.exe : fatal error LNK1120: 1 externes non r‚solus
          > NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\link.EXE"' : code retour '0x460'
          > Stop.
           => source failed verification.
          Trying source 6 (type inline) of library mysql ...
            => source failed condition '!config.win32'.
          test config.sqldrivers.libraries.mysql FAILED
          looking for library oci
          Trying source 0 (type inline) of library oci ...
          None of [oci.lib] found in [] and global paths.
            => source produced no result.
          Trying source 1 (type inline) of library oci ...
            => source failed condition '!config.win32'.
          test config.sqldrivers.libraries.oci FAILED
          looking for library odbc
          Trying source 0 (type inline) of library odbc ...
          + cd /d C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && C:\Qt\5.12.5\msvc2017_64\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-winx64\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-winx64\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += odbc" "QMAKE_LIBS_ODBC = \"C:\\Program Files ^(x86^)\\Windows Kits\\10\\lib\\10.0.18362.0\\um\\x86/odbc32.lib\"" C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/config.tests/odbc
          + cd /d C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && set MAKEFLAGS=& nmake
          > Microsoft (R) Program Maintenance Utility Version 14.26.28806.0
          > Copyright (C) Microsoft Corporation. Tous droits réservés.
          > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DNDEBUG -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-winx64\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.12.5\msvc2017_64\mkspecs\win32-msvc -Fo @C:\Users\marco\AppData\Local\Temp\nmBB78.tmp
          > main.cpp
          > 	link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:odbc.exe @C:\Users\marco\AppData\Local\Temp\nmBD4E.tmp
           => source accepted.
          test config.sqldrivers.libraries.odbc succeeded
          looking for library psql
          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 ...
          None of [libpq.lib] found in [] and global paths.
            => source produced no result.
          Trying source 3 (type psqlEnv) of library psql ...
            => source failed condition '!config.win32'.
          test config.sqldrivers.libraries.psql FAILED
          looking for library sqlite2
          Trying source 0 (type inline) of library sqlite2 ...
          None of [sqlite.lib] found in [] and global paths.
            => source produced no result.
          test config.sqldrivers.libraries.sqlite2 FAILED
          looking for library tds
          Trying source 0 (type sybaseEnv) of library tds ...
          None of [NTWDBLIB.lib] found in [] and global paths.
            => source produced no result.
          Trying source 1 (type sybaseEnv) of library tds ...
            => source failed condition '!config.win32'.
          test config.sqldrivers.libraries.tds FAILED
          
          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #30

          @Markyo Make sure you start from clean state without any build artefacts from previous tries. In case you're doing out-of-source builds delete and create the build folder. Else checkout the source code again.

          M 1 Reply Last reply
          0
          • jsulmJ jsulm

            @Markyo Make sure you start from clean state without any build artefacts from previous tries. In case you're doing out-of-source builds delete and create the build folder. Else checkout the source code again.

            M Offline
            M Offline
            Markyo
            wrote on last edited by
            #31

            @jsulm I deleted the config.cache file, but still get the same result. I don't know how to check if I'm doing out-of-source builds, and what is the build folder.

            jsulmJ 1 Reply Last reply
            0
            • M Markyo

              @jsulm I deleted the config.cache file, but still get the same result. I don't know how to check if I'm doing out-of-source builds, and what is the build folder.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #32

              @Markyo said in QMYSQL driver not loaded and Library mysql is not defined:

              what is the build folder

              The folder in which you are when you call cmake.
              Out of source build means that the build folder is outside of the source folder.

              M 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Markyo said in QMYSQL driver not loaded and Library mysql is not defined:

                what is the build folder

                The folder in which you are when you call cmake.
                Out of source build means that the build folder is outside of the source folder.

                M Offline
                M Offline
                Markyo
                wrote on last edited by
                #33

                @jsulm I'm building in this folder:

                C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers
                

                I'm not sure I have to delete this folder

                jsulmJ 1 Reply Last reply
                0
                • M Markyo

                  @jsulm I'm building in this folder:

                  C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers
                  

                  I'm not sure I have to delete this folder

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #34

                  @Markyo Well, since you're not doing out of source build you should not delete it. Instead delete all build artefacts (files created during your build attempts) manually.

                  M 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @Markyo Well, since you're not doing out of source build you should not delete it. Instead delete all build artefacts (files created during your build attempts) manually.

                    M Offline
                    M Offline
                    Markyo
                    wrote on last edited by
                    #35

                    @jsulm are there files other than config.cache?

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      Mickleholts
                      Banned
                      wrote on last edited by Mickleholts
                      #36
                      This post is deleted!
                      SGaistS 1 Reply Last reply
                      0
                      • M Mickleholts

                        This post is deleted!

                        SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #37

                        @Mickleholts hi,

                        @jsulm already fave quite a lot of advices. Did you follow them ?

                        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
                        • M Offline
                          M Offline
                          Markyo
                          wrote on last edited by
                          #38

                          Hello, I'm coming back here again to look for some solutions !
                          Due to difference of version, I reinstalled another version, several times, and for my last try, with this command:

                          C:\Qt\5.12.5\msvc2017\bin\qmake.exe -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Connector C 6.1\include" MYSQL_LIBDIR="C:\Program Files\MySQL\MySQL Connector C 6.1\lib"
                          

                          I get this environment problem:

                          Project ERROR: Cannot run compiler 'cl'. Output:
                          ===================
                          ===================
                          Maybe you forgot to setup the environment?
                          

                          Honestly, I don't understand why it is so hard to use the MySQL driver..

                          jsulmJ 1 Reply Last reply
                          0
                          • Christian EhrlicherC Offline
                            Christian EhrlicherC Offline
                            Christian Ehrlicher
                            Lifetime Qt Champion
                            wrote on last edited by
                            #39

                            @Markyo said in QMYSQL driver not loaded and Library mysql is not defined:

                            Maybe you forgot to setup the environment?

                            You did not set up the MSVC environment as the error tells you - you have to run it from a MSVC command prompt. Nothing Qt specific - if you want to use a compiler in an environment you have to properly set it up.

                            Honestly, I don't understand why it is so hard to use the MySQL driver..

                            Ask Oracle why they changed their license so it can be shipped as pre-build library

                            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                            Visit the Qt Academy at https://academy.qt.io/catalog

                            M 1 Reply Last reply
                            1
                            • M Markyo

                              Hello, I'm coming back here again to look for some solutions !
                              Due to difference of version, I reinstalled another version, several times, and for my last try, with this command:

                              C:\Qt\5.12.5\msvc2017\bin\qmake.exe -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Connector C 6.1\include" MYSQL_LIBDIR="C:\Program Files\MySQL\MySQL Connector C 6.1\lib"
                              

                              I get this environment problem:

                              Project ERROR: Cannot run compiler 'cl'. Output:
                              ===================
                              ===================
                              Maybe you forgot to setup the environment?
                              

                              Honestly, I don't understand why it is so hard to use the MySQL driver..

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #40
                              This post is deleted!
                              1 Reply Last reply
                              0
                              • Christian EhrlicherC Christian Ehrlicher

                                @Markyo said in QMYSQL driver not loaded and Library mysql is not defined:

                                Maybe you forgot to setup the environment?

                                You did not set up the MSVC environment as the error tells you - you have to run it from a MSVC command prompt. Nothing Qt specific - if you want to use a compiler in an environment you have to properly set it up.

                                Honestly, I don't understand why it is so hard to use the MySQL driver..

                                Ask Oracle why they changed their license so it can be shipped as pre-build library

                                M Offline
                                M Offline
                                Markyo
                                wrote on last edited by
                                #41

                                @Christian-Ehrlicher thx so much it worked, the command tell me this:

                                Running configuration tests...
                                Checking for DB2 (IBM)... no
                                Checking for InterBase... no
                                Checking for MySQL... yes
                                Checking for OCI (Oracle)... no
                                Checking for ODBC... yes
                                Checking for PostgreSQL... no
                                Checking for SQLite (version 2)... no
                                Checking for TDS (Sybase)... no
                                Done running configuration tests.
                                
                                Configure summary:
                                
                                Qt Sql Drivers:
                                  DB2 (IBM) .............................. no
                                  InterBase .............................. no
                                  MySql .................................. yes
                                  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 'nmake'.
                                Once everything is built, you must run 'nmake install'.
                                Qt will be installed into 'C:\Qt\5.12.5\msvc2017'.
                                
                                Prior to reconfiguration, make sure you remove any leftovers from
                                the previous build.
                                

                                So, MySQL is available, I typed nmake, then nmake install, then nmake install in mysql directory, everything seems to work.

                                I rebuilt my app, and ran the app and get this:

                                QML debugging is enabled. Only use this in a safe environment.
                                QSqlDatabase: QMYSQL driver not loaded
                                QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
                                

                                Don't understand why it is available but not loaded.

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #42

                                  The driver needs the dlls to be loaded.

                                  You can help finding them modifying the PATH environment variable in the Run part of the Project panel in Qt Creator.

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

                                  M 2 Replies Last reply
                                  0
                                  • SGaistS SGaist

                                    The driver needs the dlls to be loaded.

                                    You can help finding them modifying the PATH environment variable in the Run part of the Project panel in Qt Creator.

                                    M Offline
                                    M Offline
                                    Markyo
                                    wrote on last edited by
                                    #43

                                    @SGaist After editing PATH variable to add dll's path, it finally worked !

                                    Thank you so much everyone for your time and helpful responses !

                                    1 Reply Last reply
                                    0
                                    • SGaistS SGaist

                                      The driver needs the dlls to be loaded.

                                      You can help finding them modifying the PATH environment variable in the Run part of the Project panel in Qt Creator.

                                      M Offline
                                      M Offline
                                      Markyo
                                      wrote on last edited by Markyo
                                      #44

                                      @SGaist Hello! I'm building a second app using QMySQL database, the first app (the one about this topic) works perfectly as expected, but the second tells me that the driver isn't loaded.

                                      QSqlDatabase: MYSQL driver not loaded
                                      QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
                                      

                                      I added mysql dll dir in PATH environment variable, but same problem stay the same..

                                      Have you an idea please?

                                      EDIT: nevermind, I'm just stupid, I forgot the "Q" before "MYSQL" call in code line:

                                      QSqlDatabase db = QSqlDatabase::addDatabase("MYSQL");
                                      

                                      Now it's:

                                      QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
                                      

                                      and strangely, works better..

                                      Again, thank you all for your help!

                                      1 Reply Last reply
                                      0

                                      • Login

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