Build SQL driver plugin - debug version for MariaDB to be used in VS 2022
-
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? -
Hi and welcome to devnet,
I think you have to define the build type using CMAKE_BUILD_TYPE.
-
Hi and welcome to devnet,
I think you have to define the build type using CMAKE_BUILD_TYPE.
-
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 :-)
-
L LucL has marked this topic as solved