Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63796

Building MySQL plugin via qmake and nmake (msvc17)



    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.9.0, 5.9.1, 5.9.2
    • None


      Hi all,

      I want to create the mysql plugin from source using MariaDB and MSVC2017.

      What have I done so far?

      The MinGw Way (working)

      I've copied the qtbase\src\plugins\sqldrivers\mysql\mysql.pro to mysql_edit.pro and commented out the following line :

      QMAKE_USE += mysql

      It's needed, because otherwise it still wants the native mysql sources. Which shouldn't happened at all, because you can't overwrite this flag through qmake via a minus or other "tricks":

      qmake mysql.pro "QMAKE_USE -= mysql" //doesn't work
      qmake "QMAKE_USE -= mysql" mysql.pro //doesn't work either
      qmake mysql.pro "QMAKE_USE = " //nope

      The error of not commenting out the line is attached to the thread. (mysql_qmake_flag_error.txt)

      Next step was to execute "Qt 5.9 for Desktop (MinGW 5.3.0 32 bit)" from the startmenu of Windows. Switching the directory to the source, running qmake and mingw32-make:

      CD C:\Qt_src\5.9.0\qtbase\src\plugins\sqldrivers\mysql
      qmake mysql_edit.pro "INCLUDEPATH += C:\mariadb\include\mysql" "DEPENDSPATH += C:\mariadb\include\mysql" "LIBS += C:\mariadb\lib\libmariadb.lib"

      At the end I've four files under "C:\Qt_src\5.9.0\qtbase\plugins\sqldrivers" which are the compiled plugin. Which are working in a mingw environment with a MariaDB.


      The MSVC17 way (not working)

      Now to MSVC2017, it doesn't matter if I'm using 5.9.0, 5.9.1 or 5.9.2, I'm switching via "Qt 5.9 64-bit for Desktop (MSVC 2017)" from the startmenu to the sources, executing vcvarsall,running qmake, then nmake:

      CD C:\Qt_src\5.9.0\qtbase\src\plugins\sqldrivers\mysql
      CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64
      qmake mysql_edit.pro "INCLUDEPATH += C:\mariadb\include\mysql" "DEPENDSPATH += C:\mariadb\include\mysql" "LIBS += C:\mariadb\lib\libmariadb.lib"

      Now the error - Qmake is complaining about the following:

      Project ERROR: msvc-version.conf loaded but QMAKE_MSC_VER isn't set

      I've searched through the net to find someone having a similar problem like me, but in this particular situation it seems like I'm the only one having this problem.


      At the end I've a Qt built from source via MSVC17 and it won't work with a mingw compiled mysql plugin!

      Just ask if you need more details.


      Kind regards,


        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.



              buddenha Oswald Buddenhagen
              lachrymology Mike
              0 Vote for this issue
              2 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes