Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. (MySQL) qsqlmysql.dll doesn't get created.
Forum Update on Monday, May 27th 2025

(MySQL) qsqlmysql.dll doesn't get created.

Scheduled Pinned Locked Moved Solved Installation and Deployment
42 Posts 4 Posters 6.7k 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.
  • T Offline
    T Offline
    Thelonious
    wrote on 30 Mar 2023, 18:40 last edited by Thelonious
    #1

    I apologize if i'm missing something obvious, I've never had to build drivers for QT before.

    I have QT Creator 9 and i'm trying to build an install drivers for MySQL using the "MySQL Server 8.0" and/or "Connector C++ 8.0" (I also have the MySQL Connector C 6.1).

    I command prompt into my C:\QT\6.4.3\msvc2019_64\bin folder , find the "qt-cmake.bat" file and open it to modify the path for Cmake, which is installed at "C:\Program Files\Cmake\bin\cmake.exe"

    I use the commands from the help article https://doc.qt.io/qt-6/sql-driver.html, specifically

    *I am using the 6.1 Connector since it's in the examples
    *If i'm understanding properly I need the CMakeLists.txt located in ....\sqldrivers

    qt-cmake C:\QT\6.4.3\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=C:\QT\6.4.3\mscv2019_64 -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Connector c 6.1\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Connector c 6.1\lib\libmysql.lib"

    OUTPUT:

    -- Building for: Visual Studio 17 2022
    -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19044.
    -- The CXX compiler identification is MSVC 19.35.32216.1
    -- The C compiler identification is MSVC 19.35.32216.1
    -- The ASM compiler identification is MSVC
    -- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - not found
    -- Found Threads: TRUE
    -- Performing Test HAVE_STDATOMIC
    -- Performing Test HAVE_STDATOMIC - Success
    -- Found WrapAtomic: TRUE
    
    -- Configuration summary shown below. It has also been written to C:/Qt/6.4.3/msvc2019_64/bin/config.summary
    -- Configure with --log-level=STATUS or higher to increase CMake's message verbosity. The log level does not persist across reconfigurations.
    
    -- Configure summary:
    
    Qt Sql Drivers:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. yes
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. no
      SQLite ................................. yes
        Using system provided SQLite ......... no
    
    
    -- Configuring done (26.6s)
    -- Generating done (0.9s)
    -- Build files have been written to: C:/Qt/6.4.3/msvc2019_64/bin
    

    And it creates the plugins successfully (to the ...\msvc2019_64\bin folder) however it doesn't create the qsqlmysql.dll or qsqlmysqld.pdb. cmake --build . and cmake --install . give errors

    PLUGINS CREATED:

    352b3666-d09e-4eaf-a6f3-604abd772484-image.png

    Can someone please guide as to why I can't get the QSQLMYSQL.dll and QSQLMYSQL.pdb created so I can put them into C:\Qt\6.4.3\msvc2019_64\plugins\sqldrivers

    EDIT 1:

    I moved cmake.exe into the ...\msvc2019_64\bin folder and ran cmake --build . and got

    MSBuild version 17.5.1+f6fdcf537 for .NET Framework
    
      Checking Build System
      Automatic MOC for target QMYSQLDriverPlugin
      Generating RelWithDebInfo/QMYSQLDriverPlugin_resource.rc
      Generating Debug/QMYSQLDriverPlugin_resource.rc
      Building Custom Rule C:/Qt/6.4.3/Src/qtbase/src/plugins/sqldrivers/mysql/CMakeLists.txt
    cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\my
    sql\QMYSQLDriverPlugin.vcxproj]
      Automatic MOC for target QODBCDriverPlugin
      Generating RelWithDebInfo/QODBCDriverPlugin_resource.rc
      Generating Debug/QODBCDriverPlugin_resource.rc
      Building Custom Rule C:/Qt/6.4.3/Src/qtbase/src/plugins/sqldrivers/odbc/CMakeLists.txt
    cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\od
    bc\QODBCDriverPlugin.vcxproj]
      Automatic MOC for target QSQLiteDriverPlugin
      Generating RelWithDebInfo/QSQLiteDriverPlugin_resource.rc
      Generating Debug/QSQLiteDriverPlugin_resource.rc
      Building Custom Rule C:/Qt/6.4.3/Src/qtbase/src/plugins/sqldrivers/sqlite/CMakeLists.txt
    cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\sq
    lite\QSQLiteDriverPlugin.vcxproj]
    
    S 1 Reply Last reply 30 Mar 2023, 18:49
    0
    • T Thelonious
      30 Mar 2023, 18:40

      I apologize if i'm missing something obvious, I've never had to build drivers for QT before.

      I have QT Creator 9 and i'm trying to build an install drivers for MySQL using the "MySQL Server 8.0" and/or "Connector C++ 8.0" (I also have the MySQL Connector C 6.1).

      I command prompt into my C:\QT\6.4.3\msvc2019_64\bin folder , find the "qt-cmake.bat" file and open it to modify the path for Cmake, which is installed at "C:\Program Files\Cmake\bin\cmake.exe"

      I use the commands from the help article https://doc.qt.io/qt-6/sql-driver.html, specifically

      *I am using the 6.1 Connector since it's in the examples
      *If i'm understanding properly I need the CMakeLists.txt located in ....\sqldrivers

      qt-cmake C:\QT\6.4.3\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=C:\QT\6.4.3\mscv2019_64 -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Connector c 6.1\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Connector c 6.1\lib\libmysql.lib"

      OUTPUT:

      -- Building for: Visual Studio 17 2022
      -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19044.
      -- The CXX compiler identification is MSVC 19.35.32216.1
      -- The C compiler identification is MSVC 19.35.32216.1
      -- The ASM compiler identification is MSVC
      -- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
      -- Looking for pthread_create in pthreads
      -- Looking for pthread_create in pthreads - not found
      -- Looking for pthread_create in pthread
      -- Looking for pthread_create in pthread - not found
      -- Found Threads: TRUE
      -- Performing Test HAVE_STDATOMIC
      -- Performing Test HAVE_STDATOMIC - Success
      -- Found WrapAtomic: TRUE
      
      -- Configuration summary shown below. It has also been written to C:/Qt/6.4.3/msvc2019_64/bin/config.summary
      -- Configure with --log-level=STATUS or higher to increase CMake's message verbosity. The log level does not persist across reconfigurations.
      
      -- Configure summary:
      
      Qt Sql Drivers:
        DB2 (IBM) .............................. no
        InterBase .............................. no
        MySql .................................. yes
        OCI (Oracle) ........................... no
        ODBC ................................... yes
        PostgreSQL ............................. no
        SQLite ................................. yes
          Using system provided SQLite ......... no
      
      
      -- Configuring done (26.6s)
      -- Generating done (0.9s)
      -- Build files have been written to: C:/Qt/6.4.3/msvc2019_64/bin
      

      And it creates the plugins successfully (to the ...\msvc2019_64\bin folder) however it doesn't create the qsqlmysql.dll or qsqlmysqld.pdb. cmake --build . and cmake --install . give errors

      PLUGINS CREATED:

      352b3666-d09e-4eaf-a6f3-604abd772484-image.png

      Can someone please guide as to why I can't get the QSQLMYSQL.dll and QSQLMYSQL.pdb created so I can put them into C:\Qt\6.4.3\msvc2019_64\plugins\sqldrivers

      EDIT 1:

      I moved cmake.exe into the ...\msvc2019_64\bin folder and ran cmake --build . and got

      MSBuild version 17.5.1+f6fdcf537 for .NET Framework
      
        Checking Build System
        Automatic MOC for target QMYSQLDriverPlugin
        Generating RelWithDebInfo/QMYSQLDriverPlugin_resource.rc
        Generating Debug/QMYSQLDriverPlugin_resource.rc
        Building Custom Rule C:/Qt/6.4.3/Src/qtbase/src/plugins/sqldrivers/mysql/CMakeLists.txt
      cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\my
      sql\QMYSQLDriverPlugin.vcxproj]
        Automatic MOC for target QODBCDriverPlugin
        Generating RelWithDebInfo/QODBCDriverPlugin_resource.rc
        Generating Debug/QODBCDriverPlugin_resource.rc
        Building Custom Rule C:/Qt/6.4.3/Src/qtbase/src/plugins/sqldrivers/odbc/CMakeLists.txt
      cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\od
      bc\QODBCDriverPlugin.vcxproj]
        Automatic MOC for target QSQLiteDriverPlugin
        Generating RelWithDebInfo/QSQLiteDriverPlugin_resource.rc
        Generating Debug/QSQLiteDriverPlugin_resource.rc
        Building Custom Rule C:/Qt/6.4.3/Src/qtbase/src/plugins/sqldrivers/sqlite/CMakeLists.txt
      cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\sq
      lite\QSQLiteDriverPlugin.vcxproj]
      
      S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 Mar 2023, 18:49 last edited by
      #2

      Hi and welcome to devnet,

      The build folder should be out of source and out of installation tree.

      There's no need for CMAKE_INSTALL_PREFIX, qt-cmake is configured to have that knowledge already.

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

      T 1 Reply Last reply 30 Mar 2023, 18:54
      1
      • S SGaist
        30 Mar 2023, 18:49

        Hi and welcome to devnet,

        The build folder should be out of source and out of installation tree.

        There's no need for CMAKE_INSTALL_PREFIX, qt-cmake is configured to have that knowledge already.

        T Offline
        T Offline
        Thelonious
        wrote on 30 Mar 2023, 18:54 last edited by
        #3

        @SGaist

        Hi, and thank you for your response.

        I can remove CMAKE_INSTALL_PREFIX from my command, delete CMakeCache.txt and rerun?

        The build folder is the first one listed in the command and that should point to a folder outside fo C:\QT\ , correct?

        S 1 Reply Last reply 30 Mar 2023, 18:58
        0
        • T Thelonious
          30 Mar 2023, 18:54

          @SGaist

          Hi, and thank you for your response.

          I can remove CMAKE_INSTALL_PREFIX from my command, delete CMakeCache.txt and rerun?

          The build folder is the first one listed in the command and that should point to a folder outside fo C:\QT\ , correct?

          S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 30 Mar 2023, 18:58 last edited by
          #4

          It can be in a dedicated folder in the Qt folder, just not directly in one of the 6.X or 5.X.

          You can create a build_driver folder and do everything there.

          Out of curiosity, why not use Qt's provided cmake ?

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

          T 1 Reply Last reply 30 Mar 2023, 19:04
          0
          • S SGaist
            30 Mar 2023, 18:58

            It can be in a dedicated folder in the Qt folder, just not directly in one of the 6.X or 5.X.

            You can create a build_driver folder and do everything there.

            Out of curiosity, why not use Qt's provided cmake ?

            T Offline
            T Offline
            Thelonious
            wrote on 30 Mar 2023, 19:04 last edited by
            #5

            @SGaist

            I can use the set PATH command before I run cmake --build . ?

            I wasn't aware that I could. Some of the other researching I've done showed that there used to be a .pro file for the sqldrivers and you could include the paths for ..\include and ..\lib in there and run qmake on the file but those seem outdated.

            The new command i'm running:

            after building the libraries I simply

            > set PATH="C:\buildFolder"
            > cmake --build .
            

            the build still returns

            MSBuild version 17.5.1+f6fdcf537 for .NET Framework
            
              Automatic MOC for target QMYSQLDriverPlugin
            cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\my
            sql\QMYSQLDriverPlugin.vcxproj]
              Automatic MOC for target QODBCDriverPlugin
            cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\od
            bc\QODBCDriverPlugin.vcxproj]
              Automatic MOC for target QSQLiteDriverPlugin
            cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\sq
            lite\QSQLiteDriverPlugin.vcxproj]
            

            And once again thank you for your help!

            S 1 Reply Last reply 30 Mar 2023, 19:06
            0
            • T Thelonious
              30 Mar 2023, 19:04

              @SGaist

              I can use the set PATH command before I run cmake --build . ?

              I wasn't aware that I could. Some of the other researching I've done showed that there used to be a .pro file for the sqldrivers and you could include the paths for ..\include and ..\lib in there and run qmake on the file but those seem outdated.

              The new command i'm running:

              after building the libraries I simply

              > set PATH="C:\buildFolder"
              > cmake --build .
              

              the build still returns

              MSBuild version 17.5.1+f6fdcf537 for .NET Framework
              
                Automatic MOC for target QMYSQLDriverPlugin
              cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\my
              sql\QMYSQLDriverPlugin.vcxproj]
                Automatic MOC for target QODBCDriverPlugin
              cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\od
              bc\QODBCDriverPlugin.vcxproj]
                Automatic MOC for target QSQLiteDriverPlugin
              cl : command line  error D8016: '/O2' and '/RTC1' command-line options are incompatible [C:\Qt\6.4.3\msvc2019_64\bin\sq
              lite\QSQLiteDriverPlugin.vcxproj]
              

              And once again thank you for your help!

              S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 30 Mar 2023, 19:06 last edited by
              #6

              It seems you have now things interfering. Did you do a clean configure/build of the drivers ?

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

              T 1 Reply Last reply 30 Mar 2023, 19:16
              0
              • S SGaist
                30 Mar 2023, 19:06

                It seems you have now things interfering. Did you do a clean configure/build of the drivers ?

                T Offline
                T Offline
                Thelonious
                wrote on 30 Mar 2023, 19:16 last edited by
                #7

                @SGaist

                Yes I believe so. Before I made this post I uninstalled QT 6.4.3 and reinstalled it to get a clean folder.

                I must admit I may have misinterpreted your previous suggestion. When you say use a build folder outside of QT; that's where you want me to build those plugin files to, correct?

                copy qt-make.txt to the build folder, then :

                C:\buildfolder>  qt-cmake C:\QT\6.4.3\Src\qtbase\src\plugins\sqldrivers -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Connector c 6.1\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Connector c 6.1\lib\libmysql.lib
                
                S 1 Reply Last reply 30 Mar 2023, 19:19
                0
                • T Thelonious
                  30 Mar 2023, 19:16

                  @SGaist

                  Yes I believe so. Before I made this post I uninstalled QT 6.4.3 and reinstalled it to get a clean folder.

                  I must admit I may have misinterpreted your previous suggestion. When you say use a build folder outside of QT; that's where you want me to build those plugin files to, correct?

                  copy qt-make.txt to the build folder, then :

                  C:\buildfolder>  qt-cmake C:\QT\6.4.3\Src\qtbase\src\plugins\sqldrivers -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Connector c 6.1\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Connector c 6.1\lib\libmysql.lib
                  
                  S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 30 Mar 2023, 19:19 last edited by
                  #8

                  You don't need to copy any files. Just use the full path to the executable.

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

                  T 1 Reply Last reply 30 Mar 2023, 19:33
                  0
                  • S SGaist
                    30 Mar 2023, 19:19

                    You don't need to copy any files. Just use the full path to the executable.

                    T Offline
                    T Offline
                    Thelonious
                    wrote on 30 Mar 2023, 19:33 last edited by
                    #9

                    @SGaist

                    Oh, so cmake --build C:\buildfolder ?

                    Error: could not load cache
                    
                    S 1 Reply Last reply 30 Mar 2023, 20:16
                    0
                    • T Thelonious
                      30 Mar 2023, 19:33

                      @SGaist

                      Oh, so cmake --build C:\buildfolder ?

                      Error: could not load cache
                      
                      S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 30 Mar 2023, 20:16 last edited by
                      #10
                      mkdir build_folder
                      cd build_folder
                      C:/Qt/6.4.3/msvc2019_64/bin/qt-cmake <insert options here> c:/Qt/6.4.3/Src/qtbase/src/plugins/sqldrivers/mysql/
                      c:/Qt/6.4.3/msvc2019_64/bin/qt-cmake --build .
                      

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

                      T 2 Replies Last reply 30 Mar 2023, 20:25
                      1
                      • S SGaist
                        30 Mar 2023, 20:16
                        mkdir build_folder
                        cd build_folder
                        C:/Qt/6.4.3/msvc2019_64/bin/qt-cmake <insert options here> c:/Qt/6.4.3/Src/qtbase/src/plugins/sqldrivers/mysql/
                        c:/Qt/6.4.3/msvc2019_64/bin/qt-cmake --build .
                        
                        T Offline
                        T Offline
                        Thelonious
                        wrote on 30 Mar 2023, 20:25 last edited by
                        #11

                        @SGaist

                        Understood.

                        Went ahead and did that and it built the plugins in build_folder which is inside C:\Qt\6.4.3\msvc2019_65\ but not in the main path

                        Then I tried to run

                        C:\Qt\6.4.3\msvc2019_64\build_folder> cmake --build .
                        

                        *qt-cmake --build . threw an error

                        the output remains

                        3f27a5a5-3c8b-4e70-ab22-dbca009353d9-image.png

                        While I was waiting for your response (thanks again!) I searched for an answer to those errors and it was suggested that I might need to modify the CMakeLists.txt at ...\src\plugins\sqldrivers . But beyond that i'm stuck,

                        1 Reply Last reply
                        0
                        • S SGaist
                          30 Mar 2023, 20:16
                          mkdir build_folder
                          cd build_folder
                          C:/Qt/6.4.3/msvc2019_64/bin/qt-cmake <insert options here> c:/Qt/6.4.3/Src/qtbase/src/plugins/sqldrivers/mysql/
                          c:/Qt/6.4.3/msvc2019_64/bin/qt-cmake --build .
                          
                          T Offline
                          T Offline
                          Thelonious
                          wrote on 30 Mar 2023, 21:26 last edited by Thelonious
                          #12

                          @SGaist

                          I think I was able to get a good build using

                          C:\Qt\6.4.3\msvc2019_64\build-sqldrivers>qt-cmake -S C:\Qt\6.4.3\Src\qtbase\src\plugins\sqldrivers -B .
                          

                          OUTPUT:

                          -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19044.
                          
                          
                          
                          -- Configuring done (1.9s)
                          -- Generating done (0.4s)
                          CMake Warning:
                            Manually-specified variables were not used by the project:
                          
                              CMAKE_TOOLCHAIN_FILE
                          
                          
                          -- Build files have been written to: C:/Qt/6.4.3/msvc2019_64/build-sqldrivers
                          

                          and cmake --install . yielded

                          CMake Error: Could not find CMAKE_ROOT !!!
                          CMake has most likely not been installed correctly.
                          Modules directory not found in
                          C:/Qt/6.4.3/msvc2019_64/share/cmake-3.26
                          -- Install configuration: "RelWithDebInfo"
                          -- Up-to-date: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfig.cmake
                          -- Up-to-date: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfigVersion.cmake
                          -- Up-to-date: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfigVersionImpl.cmake
                          -- Installing: C:/Qt/6.4.3/msvc2019_64/./plugins/sqldrivers/qsqlmysql.dll
                          -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginTargets.cmake
                          -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginTargets-relwithdebinfo.cmake
                          -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginAdditionalTargetInfo.cmake
                          -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QODBCDriverPluginConfig.cmake
                          -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QODBCDriverPluginConfigVersion.cmake
                          -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QODBCDriverPluginConfigVersionImpl.cmake
                          CMake Error at odbc/cmake_install.cmake:45 (file):
                            file INSTALL cannot find
                            "C:/Qt/6.4.3/msvc2019_64/build-sqldrivers/plugins/sqldrivers/qsqlodbc.dll":
                            No such file or directory.
                          Call Stack (most recent call first):
                            cmake_install.cmake:42 (include)
                          

                          Which built qsqlmysql.dll and put it in C:\Qt\6.4.3\msvc2019_64\plugins\sqldrivers

                          However;

                          My project still doesn't load QMYSQL

                          Application Output:

                          QList("QSQLITE", "QODBC", "QPSQL")
                          
                          jsulmJ 1 Reply Last reply 31 Mar 2023, 06:31
                          0
                          • T Thelonious
                            30 Mar 2023, 21:26

                            @SGaist

                            I think I was able to get a good build using

                            C:\Qt\6.4.3\msvc2019_64\build-sqldrivers>qt-cmake -S C:\Qt\6.4.3\Src\qtbase\src\plugins\sqldrivers -B .
                            

                            OUTPUT:

                            -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19044.
                            
                            
                            
                            -- Configuring done (1.9s)
                            -- Generating done (0.4s)
                            CMake Warning:
                              Manually-specified variables were not used by the project:
                            
                                CMAKE_TOOLCHAIN_FILE
                            
                            
                            -- Build files have been written to: C:/Qt/6.4.3/msvc2019_64/build-sqldrivers
                            

                            and cmake --install . yielded

                            CMake Error: Could not find CMAKE_ROOT !!!
                            CMake has most likely not been installed correctly.
                            Modules directory not found in
                            C:/Qt/6.4.3/msvc2019_64/share/cmake-3.26
                            -- Install configuration: "RelWithDebInfo"
                            -- Up-to-date: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfig.cmake
                            -- Up-to-date: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfigVersion.cmake
                            -- Up-to-date: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfigVersionImpl.cmake
                            -- Installing: C:/Qt/6.4.3/msvc2019_64/./plugins/sqldrivers/qsqlmysql.dll
                            -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginTargets.cmake
                            -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginTargets-relwithdebinfo.cmake
                            -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginAdditionalTargetInfo.cmake
                            -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QODBCDriverPluginConfig.cmake
                            -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QODBCDriverPluginConfigVersion.cmake
                            -- Installing: C:/Qt/6.4.3/msvc2019_64/lib/cmake/Qt6Sql/Qt6QODBCDriverPluginConfigVersionImpl.cmake
                            CMake Error at odbc/cmake_install.cmake:45 (file):
                              file INSTALL cannot find
                              "C:/Qt/6.4.3/msvc2019_64/build-sqldrivers/plugins/sqldrivers/qsqlodbc.dll":
                              No such file or directory.
                            Call Stack (most recent call first):
                              cmake_install.cmake:42 (include)
                            

                            Which built qsqlmysql.dll and put it in C:\Qt\6.4.3\msvc2019_64\plugins\sqldrivers

                            However;

                            My project still doesn't load QMYSQL

                            Application Output:

                            QList("QSQLITE", "QODBC", "QPSQL")
                            
                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 31 Mar 2023, 06:31 last edited by
                            #13

                            @Thelonious said in (MySQL) qsqlmysql.dll doesn't get created.:

                            My project still doesn't load QMYSQL

                            Then set QT_DEBUG_PLUGINS to 1 before running your app and check the output to see why the MySQL plug-in was not loaded. Probably the mysql client library could not be found.

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            Christian EhrlicherC 1 Reply Last reply 31 Mar 2023, 06:33
                            0
                            • jsulmJ jsulm
                              31 Mar 2023, 06:31

                              @Thelonious said in (MySQL) qsqlmysql.dll doesn't get created.:

                              My project still doesn't load QMYSQL

                              Then set QT_DEBUG_PLUGINS to 1 before running your app and check the output to see why the MySQL plug-in was not loaded. Probably the mysql client library could not be found.

                              Christian EhrlicherC Offline
                              Christian EhrlicherC Offline
                              Christian Ehrlicher
                              Lifetime Qt Champion
                              wrote on 31 Mar 2023, 06:33 last edited by
                              #14

                              @jsulm said in (MySQL) qsqlmysql.dll doesn't get created.:

                              Probably the mysql client library could not be found

                              In this case the plugin would at least show up in the available plugins list.
                              I would guess it's the wrong Qt directory.

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

                              T 1 Reply Last reply 31 Mar 2023, 12:48
                              1
                              • Christian EhrlicherC Christian Ehrlicher
                                31 Mar 2023, 06:33

                                @jsulm said in (MySQL) qsqlmysql.dll doesn't get created.:

                                Probably the mysql client library could not be found

                                In this case the plugin would at least show up in the available plugins list.
                                I would guess it's the wrong Qt directory.

                                T Offline
                                T Offline
                                Thelonious
                                wrote on 31 Mar 2023, 12:48 last edited by
                                #15

                                @Christian-Ehrlicher

                                So I should move my recently created qsqlmysql.dll into the same folder as my project executable? Do I need to move my plugins from C:\Qt\6.4.3\msvc2019_64\build-sqldrivers?

                                Thanks for your help,

                                Christian EhrlicherC 1 Reply Last reply 31 Mar 2023, 12:59
                                0
                                • T Thelonious
                                  31 Mar 2023, 12:48

                                  @Christian-Ehrlicher

                                  So I should move my recently created qsqlmysql.dll into the same folder as my project executable? Do I need to move my plugins from C:\Qt\6.4.3\msvc2019_64\build-sqldrivers?

                                  Thanks for your help,

                                  Christian EhrlicherC Offline
                                  Christian EhrlicherC Offline
                                  Christian Ehrlicher
                                  Lifetime Qt Champion
                                  wrote on 31 Mar 2023, 12:59 last edited by
                                  #16

                                  @Thelonious said in (MySQL) qsqlmysql.dll doesn't get created.:

                                  So I should move my recently created qsqlmysql.dll into the same folder as my project executable?

                                  I never said this. I just think that C:\Qt\6.4.3\ is not the Qt you're using while running your executable. When you would have followed @jsulm's advise we would have known more.

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

                                  T 1 Reply Last reply 31 Mar 2023, 13:19
                                  0
                                  • Christian EhrlicherC Christian Ehrlicher
                                    31 Mar 2023, 12:59

                                    @Thelonious said in (MySQL) qsqlmysql.dll doesn't get created.:

                                    So I should move my recently created qsqlmysql.dll into the same folder as my project executable?

                                    I never said this. I just think that C:\Qt\6.4.3\ is not the Qt you're using while running your executable. When you would have followed @jsulm's advise we would have known more.

                                    T Offline
                                    T Offline
                                    Thelonious
                                    wrote on 31 Mar 2023, 13:19 last edited by Thelonious
                                    #17

                                    @Christian-Ehrlicher

                                    qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.3/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll"
                                    qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.3/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll, metadata=
                                    {
                                        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                                        "MetaData": {
                                            "Keys": [
                                                "QMYSQL",
                                                "QMARIADB"
                                            ]
                                        },
                                        "archlevel": 0,
                                        "className": "QMYSQLDriverPlugin",
                                        "debug": false,
                                        "version": 394240
                                    }
                                    
                                    
                                    qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.3/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
                                             not a plugin
                                    
                                    Christian EhrlicherC 1 Reply Last reply 31 Mar 2023, 13:24
                                    0
                                    • T Thelonious
                                      31 Mar 2023, 13:19

                                      @Christian-Ehrlicher

                                      qt.core.plugin.factoryloader: looking at "C:/Qt/6.4.3/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll"
                                      qt.core.plugin.loader: Found metadata in lib C:/Qt/6.4.3/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll, metadata=
                                      {
                                          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                                          "MetaData": {
                                              "Keys": [
                                                  "QMYSQL",
                                                  "QMARIADB"
                                              ]
                                          },
                                          "archlevel": 0,
                                          "className": "QMYSQLDriverPlugin",
                                          "debug": false,
                                          "version": 394240
                                      }
                                      
                                      
                                      qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.3/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
                                               not a plugin
                                      
                                      Christian EhrlicherC Offline
                                      Christian EhrlicherC Offline
                                      Christian Ehrlicher
                                      Lifetime Qt Champion
                                      wrote on 31 Mar 2023, 13:24 last edited by
                                      #18

                                      @Thelonious said in (MySQL) qsqlmysql.dll doesn't get created.:

                                      qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.3/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
                                      not a plugin

                                      So you only compiled the release plugin but running a debug app.

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

                                      T 1 Reply Last reply 31 Mar 2023, 13:32
                                      0
                                      • Christian EhrlicherC Christian Ehrlicher
                                        31 Mar 2023, 13:24

                                        @Thelonious said in (MySQL) qsqlmysql.dll doesn't get created.:

                                        qt.core.plugin.factoryloader: "The plugin 'C:/Qt/6.4.3/msvc2019_64/plugins/sqldrivers/qsqlmysql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
                                        not a plugin

                                        So you only compiled the release plugin but running a debug app.

                                        T Offline
                                        T Offline
                                        Thelonious
                                        wrote on 31 Mar 2023, 13:32 last edited by
                                        #19

                                        @Christian-Ehrlicher
                                        I apologize; the QT help article on building MySQL drivers doesn't specify how to make a debug version. Can you please point me somewhere that explains the difference or shows me hot to make the debug plugin?

                                        Christian EhrlicherC 1 Reply Last reply 31 Mar 2023, 14:25
                                        0
                                        • T Thelonious
                                          31 Mar 2023, 13:32

                                          @Christian-Ehrlicher
                                          I apologize; the QT help article on building MySQL drivers doesn't specify how to make a debug version. Can you please point me somewhere that explains the difference or shows me hot to make the debug plugin?

                                          Christian EhrlicherC Offline
                                          Christian EhrlicherC Offline
                                          Christian Ehrlicher
                                          Lifetime Qt Champion
                                          wrote on 31 Mar 2023, 14:25 last edited by Christian Ehrlicher
                                          #20

                                          Either open the generated solution and build the debug version (can also be done from the command line but I don't remember the commands) or use -G Ninja or -G NMake Makefiles for the cmake generator - they both produce rules to create both plugins directly. Maybe we should add this to the documentation. MSBuild is not meant to be run on the command line and therefore has a lot of strange switches...

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

                                          T 2 Replies Last reply 31 Mar 2023, 14:44
                                          0

                                          1/42

                                          30 Mar 2023, 18:40

                                          • Login

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