Error building Qt MySQL driver, windows 10.
-
Hi all,
Please, I need some help to build Qt MySQL driver.
My system is Windows 10.Steps I've done so far:
-I've downloaded Qt, file: qt-opensource-windows-x86-5.11.1.exe and I've installed it in folder "C:\Qt\Qt5.11.1". I Checked "MinGW 5.3.0 32 bit" only.
-I'm able to run Qt Creator, to build and run Qt SQL projects using SQLite into a file, all is OK!I'm trying to build MySQL driver, based on page: https://www.seppemagiels.com/blog/create-mysql-driver-qt5-windows
-I downloaded Qt source, file: qt-everywhere-opensource-src-5.8.0.tar.gz and extracted in folder "C:\Qt".
-I renamed the folder "qt-everywhere-opensource-src-5.8.0" to "Sources" ("C:\Qt\Sources") for simplicity.
-I downloaded MySQL C Connector, file: mysql-connector-c-6.1.11-win32.msi and installed it in "C:\Program Files (x86)\MySQL\MySQL Connector C 6.1", the short path is: "C:\PROGRA~2\MySQL\MYSQLC~1.1".
-I invoked cmd "Qt 5.11.1 for Desktop (MinGW 5.3.0 32 bit)". The system PATH envirment variable has C:\Qt\Qt5.11.1\5.11.1\mingw53_32\bin; & C:/Qt/Qt5.11.1/Tools/mingw530_32\bin;According to the instructions, I typed:
set mysql=C:\PROGRA~2\MySQL\MYSQLC~1.1
cd C:\Qt\Sources\qtbase\src\plugins\sqldrivers\mysql
qmake "INCLUDEPATH+=%mysql%\include" "LIBS+=%mysql%\lib\libmysql.lib" -o Makefile mysql.pro...and I'm getting this error:
Info: creating stash file C:\Qt\Sources\qtbase.qmake.stash
Project ERROR: Library 'mysql' is not defined.There is a "QMAKE_USE += mysql" inside mysql.pro and when I commented it, I'm getting another error:
Project ERROR: Library 'libatomic' is not defined.If I open mysql.pro with Qt Creator, I'm getting that I have to configure it. I click in "Configure Project" and I'm getting these messages:
Running Windows Runtime device detection.
No winrtrunner.exe found.
Project ERROR: Project has no top-level .qmake.conf file.
Error while parsing file C:\Qt\Sources\qtbase\src\plugins\sqldrivers\mysql\mysql.pro. Giving up.
Project ERROR: Project has no top-level .qmake.conf file.
Error while parsing file C:\Qt\Sources\qtbase\src\plugins\sqldrivers\mysql\mysql.pro. Giving up.
Project ERROR: Project has no top-level .qmake.conf file.
Error while parsing file C:\Qt\Sources\qtbase\src\plugins\sqldrivers\mysql\mysql.pro. Giving up.
Cannot read /mkspecs/modules-inst/qt_plugin_qsqlmysql.pri: No such file or directory
Project ERROR: Library 'mysql' is not defined.I'm getting exactly the same results in two different PCs.
Thank'you in advance!
-
Hi and welcome to devnet,
These instructions are a bit outdated as the configuration system has changed a bit, see the official Qt documentation about that subject.
-
IIRC, if you start from the git clone. Why not use the archive corresponding to your Qt version ?