Building MySQL driver with Qt 5.13.1
-
I'm working with Qt 5.13.1 and need to load the MySQL driver.
So far I have tried copying the required DLLs (which were provided for me by someone) into C:\Qt\5.13.1\msvc2017_64\plugins\sqldrivers, however the following output is generated:QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
Google suggested that I need to build the driver, so I tried following the instructions on https://doc.qt.io/qt-5/sql-driver.html#qmysql.
However, running cd %QTDIR%\qtbase\src\plugins\sqldrivers returns:
The system cannot find the path specified.
I've downloaded the sources for Qt 5.13.1 so can't think why the path can't be found.
Does anyone have any experience making MySQL work with Qt 5.13.1 (MSVC 2017 64-bit)?
-
So did you open the Qt command prompt? If so the env variable QTDIR should be set.
-
@caxelc said in Building MySQL driver with Qt 5.13.1:
How can I check if it is?
You should know if you simply opened a cmd.exe or started the Qt command prompt.
echo %QTDIR%
(basic windows stuff - see e.g. here: https://docs.microsoft.com/de-de/windows-server/administration/windows-commands/set_1 )
-
Ok, so I've tried this:
C:\Qt\5.13.1\msvc2017_64>cd C:\Qt\5.13.1\Src\qtbase\src\plugins\sqldrivers C:\Qt\5.13.1\Src\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR="C:\Program Files\MySQL\Connector C++ 8.0\include" MYSQL_LIBDIR="C:\Program Files\MySQL\Connector C++ 8.0\lib64" Project ERROR: Cannot run compiler 'cl'. Output: =================== =================== Maybe you forgot to setup the environment?