Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Building QMYSQL / MARIADB with Qt 6.3.0
Forum Updated to NodeBB v4.3 + New Features

Building QMYSQL / MARIADB with Qt 6.3.0

Scheduled Pinned Locked Moved Unsolved Qt 6
qmysqlmariadb3.6.0
13 Posts 2 Posters 2.4k Views 1 Watching
  • 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.
  • SGaistS SGaist

    Hi and welcome to devnet,

    If memory serves well, the online installer also provides the option to install cmake.

    As for the loading issue, start your application with the QT_DEBUG_PLUGINS environment variable set to 1. You can do that in the Run part of the Project panel.

    A Offline
    A Offline
    AnUnusualRemote
    wrote on last edited by AnUnusualRemote
    #4

    Sorry, I have done that correct, I just found it.
    That doesn't seem to have done anything, in fact it was already set towards 1 when I checked. The online installer also seems to have CMake 3.21.1 64-bit showing as installed under Developer and Designer Tools.

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

      If the environment variable is properly defined, you should have a dump of information about the plugins being loaded and why they failed.

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

      A 1 Reply Last reply
      0
      • SGaistS SGaist

        If the environment variable is properly defined, you should have a dump of information about the plugins being loaded and why they failed.

        A Offline
        A Offline
        AnUnusualRemote
        wrote on last edited by
        #6

        @SGaist
        I'm assuming this would be

        {
            "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
            "MetaData": {
                "Keys": [
                    "QMYSQL",
                    "QMARIADB"
                ]
            },
            "archlevel": 0,
            "className": "QMYSQLDriverPlugin",
            "debug": true,
            "version": 393728
        }
        
        
        qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMYSQL", "QMARIADB")
        qt.core.plugin.factoryloader: looking at "C:/Qt/6.3.0/mingw_64/plugins/sqldrivers/qsqlodbc.dll"
        qt.core.plugin.loader: Found metadata in lib C:/Qt/6.3.0/mingw_64/plugins/sqldrivers/qsqlodbc.dll, metadata=
        

        Along with this line.

        qt.core.library: "C:/Qt/6.3.0/mingw_64/plugins/sqldrivers/qsqlmysql.dll" cannot load: Cannot load library C:\Qt\6.3.0\mingw_64\plugins\sqldrivers\qsqlmysql.dll: The specified module could not be found.
        qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "C:/Qt/6.3.0/mingw_64/plugins/sqldrivers/qsqlmysql.dll" : "Cannot load library C:\\Qt\\6.3.0\\mingw_64\\plugins\\sqldrivers\\qsqlmysql.dll: The specified module could not be found."
        

        sqldriver folder containing .dll files
        Since that's the sqldriver folder, I checked. Results are above. I can only guess that there's a missing .debug file, or that the .dll is incompatible with Qt for some reason.

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

          Maybe a silly question but are you sure that the dll you have now is from the correct compiler ?

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

          A 1 Reply Last reply
          0
          • SGaistS SGaist

            Maybe a silly question but are you sure that the dll you have now is from the correct compiler ?

            A Offline
            A Offline
            AnUnusualRemote
            wrote on last edited by
            #8

            @SGaist
            Very likely that it may not be from the right compiler, I could not compile it, so I asked a friend to instead. I suppose my best option right now is to try and build everything myself.

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

              You do not have to rebuild everything. Just the plugin.

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

              A 1 Reply Last reply
              0
              • SGaistS SGaist

                You do not have to rebuild everything. Just the plugin.

                A Offline
                A Offline
                AnUnusualRemote
                wrote on last edited by
                #10

                @SGaist
                I'm not entirely sure how to build it based on the documentation. I have the files for MariaDB location in the right folders when it comes to the .lib, .dll and .h files. Problem is that I'm not sure where I should be for building the plugins when it comes to the command prompt.

                mkdir build-sqldrivers
                cd build-sqldrivers
                
                qt-cmake -G Ninja <qt_installation_path>\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=<qt_installation_path>\<platform> -DMySQL_INCLUDE_DIR="C:\mysql-8.0.22-winx64\include" -DMySQL_LIBRARY="C:\mysql-8.0.22-winx64\lib\libmysql.lib"
                cmake --build .
                cmake --install .
                

                I'm not entirely sure where I should be located within my file structure to build the plugins, inside of the Qt 6.3.0 folder? The bin folder of the Qt 6.3.0 folder perhaps? qt-cmake doesn't seem to be recgonised as a command, so I assume it's located somewhere inside of the Qt folder.

                'qt-cmake' is not recognized as an internal or external command, operable program or batch file.
                

                I also do not know what Ninja refers to within the command. Do I need to install this too?

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

                  Try with just cmake in place of qt-cmake.

                  As for Ninja, it's also available through the installer.

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

                  A 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Try with just cmake in place of qt-cmake.

                    As for Ninja, it's also available through the installer.

                    A Offline
                    A Offline
                    AnUnusualRemote
                    wrote on last edited by
                    #12

                    @SGaist
                    Since I'm using and building for MariaDB

                    qt-cmake -G Ninja <qt_installation_path>\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=<qt_installation_path>\<platform> -DMySQL_INCLUDE_DIR="C:\mysql-8.0.22-winx64\include" -DMySQL_LIBRARY="C:\mysql-8.0.22-winx64\lib\libmysql.lib"
                    

                    The DMySQL and DMySQL_LIBRARY should probably be replaced with DMariaDB or some equivalent, correct? The locations will change, but obviously those are where I've installed the relevant files.

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

                      From memory, no, MariaDB is a drop in replacement so it would not make sense to complicate the build system for that.

                      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

                      • Login

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