Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Error building Qt MySQL driver, windows 10.
QtWS25 Last Chance

Error building Qt MySQL driver, windows 10.

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
mysql driver
4 Posts 2 Posters 1.3k Views
  • 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.
  • M Offline
    M Offline
    Minas
    wrote on 6 Sept 2018, 10:08 last edited by
    #1

    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!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 6 Sept 2018, 21:23 last edited by
      #2

      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.

      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
      1
      • M Offline
        M Offline
        Minas
        wrote on 8 Sept 2018, 15:23 last edited by
        #3

        Hi, thanks for the reply!
        I tried to run configure and it needs perl!
        I'm afraid I have to setup the whole environment as it is to build Qt!
        Does anybody have the Qt MySQL driver for windows & MinGW32?
        The driver is just a .dll file isn't it?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 9 Sept 2018, 22:15 last edited by
          #4

          IIRC, if you start from the git clone. Why not use the archive corresponding to your Qt version ?

          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

          1/4

          6 Sept 2018, 10:08

          • Login

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