Results 1 to 2 of 2

Thread: Build the MySQL driver in QT 5.11

  1. #1
    Join Date
    Aug 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Build the MySQL driver in QT 5.11

    hello all can someone help me please
    Sorry for my english

    I can not compile the driver for MySql, read a lot of information

    First I compiled qt 5.11 from the sources with the keys
    -shared -debug-and-release -platform win32-g++ -prefix D:\Qt\5.11\5.11-x64 -opensource -confirm-license -c++std c++14 -nomake examples -skip wayland -skip purchasing -skip serialbus -skip qtserialport -skip script -skip scxml -skip speech -skip location -opengl desktop -qt-zlib -qt-pcre -qt-libpng -qt-freetype -openssl-linked -I D:\Qt\openssl-1.0.2\dist\include -L D:\Qt\openssl-1.0.2\dist\lib OPENSSL_LIBS="-llibssl -llibcrypto -luser32 -lgdi32 -lwsock32 -lws2_32"

    Compiled on Windows 10 Pro x64. To compile, I used mingw-w64, also installed everything needed to build.

    Downloaded and installed "MySQL Connector C 6.1", installed it into the C: \ MySql directory. (first installed the version of x64, but then after it did not work with it reinstalled on x86 and did all the work with it)

    Then, as it is written in the official documentation http://doc.qt.io/qt-5/sql-driver.html#qmysql moved to the directory "%QTDIR%\qtbase\src\plugins\sqldrivers" and executed there
    "qmake -- MYSQL_INCDIR=C:/MySQL/include "MYSQL_LIBDIR=C:/MYSQL/lib" "
    mingw32-make sub-mysql

    but got an error
    "mingw32-make: *** No rule to make target 'sub-mysql'. Stop."

    Looked at the Makefile, sub-mysql does not really exist there, if just do mingw32-make then the assembly of OBDC and SqlLite is going on, Mysql is not going to.

    After that, I read a lot of information and found this resource https://mike-mvk.livejournal.com/4196.html in which they say that first need to convert libmysql.dll to libmysql.a, performed the transformation and repeated everything anew, the error is the same.
    Then I tried to do as written on the specified resource
    cd %QTDIR%\src\plugins\sqldrivers\mysql
    qmake -o Makefile "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MySQL\lib\libmysql.a" mysql.pro

    but again got an error
    Project ERROR: Library 'mysql' is not defined.

    After that I decided to build QT already with MySql support, took clean sources and tried to configure with parameters
    -shared -debug-and-release -platform win32-g++ -prefix D:\Qt\5.11\5.11-x64 -opensource -confirm-license -c++std c++14 -nomake examples -skip wayland -skip purchasing -skip serialbus -skip qtserialport -skip script -skip scxml -skip speech -skip location -opengl desktop -qt-zlib -qt-pcre -qt-libpng -no-libjpeg -qt-freetype -openssl-linked -I D:\Qt\openssl-1.0.2\dist\include -L D:\Qt\openssl-1.0.2\dist\lib OPENSSL_LIBS="-llibssl -llibcrypto -luser32 -lgdi32 -lwsock32 -lws2_32" -sql-mysql MYSQL_INCDIR=C:\MySQL\include MYSQL_LIBDIR=C:\MySQL\lib MYSQL_LIBS=-lmysqld

    But when configuring, MySql does not pass "MySql .. no" and at the end there is an error message "ERROR: Feature 'sql-mysql' was enabled, but the pre-condition 'libs.mysql' failed."

    I decided to download qt-opensource-windows-x86-5.11.1.exe and compile the x86 version of the driver, because somewhere I read that it will work with x64, but got all the same errors.

    Has anyone successfully assembled the MySql driver for Qt 5.11 or 5.10?
    If you compiled, then tell me please, where there can be a mistake, re-read the entire Internet, none of the methods helped solve the problem.

  2. #2
    Join Date
    Jan 2018
    Posts
    1
    Qt products
    Qt5 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Default Re: Build the MySQL driver in QT 5.11

    hy, i have same problem! did you find any solution?

Similar Threads

  1. Replies: 4
    Last Post: 8th March 2016, 15:27
  2. (Another) Can't build MySql driver on Mac OSX
    By Gretsch in forum Installation and Deployment
    Replies: 1
    Last Post: 2nd February 2015, 22:44
  3. Build mysql driver for Andorid arm V5
    By Abel in forum Installation and Deployment
    Replies: 0
    Last Post: 29th May 2014, 08:41
  4. Mysql Driver build Issue
    By davethomaspilot in forum Installation and Deployment
    Replies: 1
    Last Post: 4th January 2014, 19:02
  5. [QT 4.6] Error build driver mysql
    By vinny gracindo in forum Installation and Deployment
    Replies: 1
    Last Post: 26th February 2010, 02:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.