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. Build SQL driver plugin - debug version for MariaDB to be used in VS 2022
Forum Updated to NodeBB v4.3 + New Features

Build SQL driver plugin - debug version for MariaDB to be used in VS 2022

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 88 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.
  • LucLL Offline
    LucLL Offline
    LucL
    wrote last edited by
    #1

    I have seen a lot of posts about building SQL Driver plugin for MySQL / MariaDB, I need the driver for development in Visual Studio 2022. The good news: based on the information I found in the forum and in the Qt Documentation, I built the MariaDB driver; I wrote a small test program and it's working fine in the RELEASE configuration of the VS project.

    In the DEBUG configuration however, there is an error loading the SQL driver.
    (Error messsage: qt.sql.qsqldatabase: QSqlDatabase: can not load requested driver 'QMARIADB', available drivers: QIBASE QSQLITE QMIMER QOCI QODBC QPSQL)

    I built the driver like this:
    call %QtInstall%%QtToolkit%\bin\qt-cmake.bat -G Ninja %QtInstall%\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=%QtInstall%%QtToolkit% -DMySQL_ROOT=%MariaDBRoot%
    cmake --build .
    cmake --install .
    When I look in the plugins/sqldrivers folder, I see that no qsqlmysqld.dll and qsqlmysql.pdb are created, only a qsqlmysql.dll, I assume that's the reason. How can I build the debug version of the driver?

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

      Hi and welcome to devnet,

      I think you have to define the build type using CMAKE_BUILD_TYPE.

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

      LucLL 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi and welcome to devnet,

        I think you have to define the build type using CMAKE_BUILD_TYPE.

        LucLL Offline
        LucLL Offline
        LucL
        wrote last edited by
        #3

        @SGaist Many thanks, that solved my problem.
        I added
        set CMAKE_BUILD_TYPE=Debug
        to my script, before executing the cmake batch file, and the debug versions were built...

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

          Great !

          Since you have it working now, please mark the thread as solved using the "Topic Tool" button or the three dotted menu beside the answer you deem correct so other forum users may know a solution has been found :-)

          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
          • LucLL LucL has marked this topic as solved

          • Login

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