Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. building qsqlmysql.dll for msvc error
QtWS25 Last Chance

building qsqlmysql.dll for msvc error

Scheduled Pinned Locked Moved Solved General and Desktop
mysqlmysql drivermsvcqt5.15.1nmake
5 Posts 2 Posters 806 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
    mvsri
    wrote on last edited by
    #1

    Hello there,
    I have installed Qt 15.5.1 using MaitenanceTool and I know that qsqlmysql.dll doesn't get installed in plugins, I have to build it separately.

    I want to generate qsqlmysql.dll for msvc.

    I have the source code with me and tried the following steps:

    1. Opened Developer Command Prompt vs2019
    2. Go to "C:\Qt\5.15.1\msvc2019_64\bin" and drag and drop qtenve.bat in the command prompt and hit enter.
    3. Go to "C:\Qt\5.15.1\Src\qtbase\src\plugins\sqldrivers" in command prompt
    4. Entered the following lines
    qmake -- MYSQL_INCDIR="C:\mysql\include" MYSQL_LIBDIR="C:\mysql\lib
    

    (Note: I have copied include and lib folders from mysql server 8.0 to C:\mysql, include folder has mysql.h and lib folder contains libmysql.dll and libmysql.lib)

    Output was like this:

    Info: creating stash file C:\Qt\5.15.1\Src\qtbase\src\plugins\sqldrivers\.qmake.stash
    
    Running configuration tests...
    Checking for DB2 (IBM)... no
    Checking for InterBase... no
    Checking for MySQL... yes
    Checking for OCI (Oracle)... no
    Checking for ODBC... yes
    Checking for PostgreSQL... no
    Checking for SQLite (version 2)... no
    Checking for TDS (Sybase)... no
    Done running configuration tests.
    
    Configure summary:
    
    Qt Sql Drivers:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. yes
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    
    Qt is now configured for building. Just run 'nmake'.
    Once everything is built, you must run 'nmake install'.
    Qt will be installed into 'C:\Qt\5.15.1\msvc2019_64'.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

    After this I entered the following line on command prompt:

    namke
    

    and I got the following error:

    Microsoft (R) Program Maintenance Utility Version 14.29.30139.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
            cd mysql\ && ( if not exist Makefile C:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -o Makefile C:\Qt\5.15.1\Src\qtbase\src\plugins\sqldrivers\mysql\mysql.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe" -f Makefile
    
    Microsoft (R) Program Maintenance Utility Version 14.29.30139.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
            "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe" -f Makefile.Release
    
    Microsoft (R) Program Maintenance Utility Version 14.29.30139.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    NMAKE : fatal error U1073: don't know how to make 'C:/Program\'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    

    Can someone help me out here, What is the correct way to generate qsqlmysql.dll for msvc.

    Christian EhrlicherC 2 Replies Last reply
    0
    • M mvsri

      Hello there,
      I have installed Qt 15.5.1 using MaitenanceTool and I know that qsqlmysql.dll doesn't get installed in plugins, I have to build it separately.

      I want to generate qsqlmysql.dll for msvc.

      I have the source code with me and tried the following steps:

      1. Opened Developer Command Prompt vs2019
      2. Go to "C:\Qt\5.15.1\msvc2019_64\bin" and drag and drop qtenve.bat in the command prompt and hit enter.
      3. Go to "C:\Qt\5.15.1\Src\qtbase\src\plugins\sqldrivers" in command prompt
      4. Entered the following lines
      qmake -- MYSQL_INCDIR="C:\mysql\include" MYSQL_LIBDIR="C:\mysql\lib
      

      (Note: I have copied include and lib folders from mysql server 8.0 to C:\mysql, include folder has mysql.h and lib folder contains libmysql.dll and libmysql.lib)

      Output was like this:

      Info: creating stash file C:\Qt\5.15.1\Src\qtbase\src\plugins\sqldrivers\.qmake.stash
      
      Running configuration tests...
      Checking for DB2 (IBM)... no
      Checking for InterBase... no
      Checking for MySQL... yes
      Checking for OCI (Oracle)... no
      Checking for ODBC... yes
      Checking for PostgreSQL... no
      Checking for SQLite (version 2)... no
      Checking for TDS (Sybase)... no
      Done running configuration tests.
      
      Configure summary:
      
      Qt Sql Drivers:
        DB2 (IBM) .............................. no
        InterBase .............................. no
        MySql .................................. yes
        OCI (Oracle) ........................... no
        ODBC ................................... yes
        PostgreSQL ............................. no
        SQLite2 ................................ no
        SQLite ................................. yes
          Using system provided SQLite ......... no
        TDS (Sybase) ........................... no
      
      Qt is now configured for building. Just run 'nmake'.
      Once everything is built, you must run 'nmake install'.
      Qt will be installed into 'C:\Qt\5.15.1\msvc2019_64'.
      
      Prior to reconfiguration, make sure you remove any leftovers from
      the previous build.
      

      After this I entered the following line on command prompt:

      namke
      

      and I got the following error:

      Microsoft (R) Program Maintenance Utility Version 14.29.30139.0
      Copyright (C) Microsoft Corporation.  All rights reserved.
      
              cd mysql\ && ( if not exist Makefile C:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -o Makefile C:\Qt\5.15.1\Src\qtbase\src\plugins\sqldrivers\mysql\mysql.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe" -f Makefile
      
      Microsoft (R) Program Maintenance Utility Version 14.29.30139.0
      Copyright (C) Microsoft Corporation.  All rights reserved.
      
              "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe" -f Makefile.Release
      
      Microsoft (R) Program Maintenance Utility Version 14.29.30139.0
      Copyright (C) Microsoft Corporation.  All rights reserved.
      
      NMAKE : fatal error U1073: don't know how to make 'C:/Program\'
      Stop.
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.
      

      Can someone help me out here, What is the correct way to generate qsqlmysql.dll for msvc.

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @mvsri said in building qsqlmysql.dll for msvc error:

      What is the correct way to generate qsqlmysql.dll for msvc.

      This is the correct way.
      Do you have a bash/sh.exe somewhere in your PATH env var?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      M 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @mvsri said in building qsqlmysql.dll for msvc error:

        What is the correct way to generate qsqlmysql.dll for msvc.

        This is the correct way.
        Do you have a bash/sh.exe somewhere in your PATH env var?

        M Offline
        M Offline
        mvsri
        wrote on last edited by
        #3

        @Christian-Ehrlicher No I don't have bash/sh in my PATH env

        1 Reply Last reply
        0
        • M mvsri

          Hello there,
          I have installed Qt 15.5.1 using MaitenanceTool and I know that qsqlmysql.dll doesn't get installed in plugins, I have to build it separately.

          I want to generate qsqlmysql.dll for msvc.

          I have the source code with me and tried the following steps:

          1. Opened Developer Command Prompt vs2019
          2. Go to "C:\Qt\5.15.1\msvc2019_64\bin" and drag and drop qtenve.bat in the command prompt and hit enter.
          3. Go to "C:\Qt\5.15.1\Src\qtbase\src\plugins\sqldrivers" in command prompt
          4. Entered the following lines
          qmake -- MYSQL_INCDIR="C:\mysql\include" MYSQL_LIBDIR="C:\mysql\lib
          

          (Note: I have copied include and lib folders from mysql server 8.0 to C:\mysql, include folder has mysql.h and lib folder contains libmysql.dll and libmysql.lib)

          Output was like this:

          Info: creating stash file C:\Qt\5.15.1\Src\qtbase\src\plugins\sqldrivers\.qmake.stash
          
          Running configuration tests...
          Checking for DB2 (IBM)... no
          Checking for InterBase... no
          Checking for MySQL... yes
          Checking for OCI (Oracle)... no
          Checking for ODBC... yes
          Checking for PostgreSQL... no
          Checking for SQLite (version 2)... no
          Checking for TDS (Sybase)... no
          Done running configuration tests.
          
          Configure summary:
          
          Qt Sql Drivers:
            DB2 (IBM) .............................. no
            InterBase .............................. no
            MySql .................................. yes
            OCI (Oracle) ........................... no
            ODBC ................................... yes
            PostgreSQL ............................. no
            SQLite2 ................................ no
            SQLite ................................. yes
              Using system provided SQLite ......... no
            TDS (Sybase) ........................... no
          
          Qt is now configured for building. Just run 'nmake'.
          Once everything is built, you must run 'nmake install'.
          Qt will be installed into 'C:\Qt\5.15.1\msvc2019_64'.
          
          Prior to reconfiguration, make sure you remove any leftovers from
          the previous build.
          

          After this I entered the following line on command prompt:

          namke
          

          and I got the following error:

          Microsoft (R) Program Maintenance Utility Version 14.29.30139.0
          Copyright (C) Microsoft Corporation.  All rights reserved.
          
                  cd mysql\ && ( if not exist Makefile C:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -o Makefile C:\Qt\5.15.1\Src\qtbase\src\plugins\sqldrivers\mysql\mysql.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe" -f Makefile
          
          Microsoft (R) Program Maintenance Utility Version 14.29.30139.0
          Copyright (C) Microsoft Corporation.  All rights reserved.
          
                  "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe" -f Makefile.Release
          
          Microsoft (R) Program Maintenance Utility Version 14.29.30139.0
          Copyright (C) Microsoft Corporation.  All rights reserved.
          
          NMAKE : fatal error U1073: don't know how to make 'C:/Program\'
          Stop.
          NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"' : return code '0x2'
          Stop.
          NMAKE : fatal error U1077: 'cd' : return code '0x2'
          Stop.
          

          Can someone help me out here, What is the correct way to generate qsqlmysql.dll for msvc.

          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @mvsri said in building qsqlmysql.dll for msvc error:

          MYSQL_LIBDIR="C:\mysql\lib

          Forgot to copy or typo? There is a " missing.

          It looks strange. Take a look into Makefile.Release in the mysql subdir and see if you see if somewhere C:/Program\ is referenced.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          M 1 Reply Last reply
          1
          • Christian EhrlicherC Christian Ehrlicher

            @mvsri said in building qsqlmysql.dll for msvc error:

            MYSQL_LIBDIR="C:\mysql\lib

            Forgot to copy or typo? There is a " missing.

            It looks strange. Take a look into Makefile.Release in the mysql subdir and see if you see if somewhere C:/Program\ is referenced.

            M Offline
            M Offline
            mvsri
            wrote on last edited by
            #5

            @Christian-Ehrlicher said in building qsqlmysql.dll for msvc error:

            Forgot to copy or typo?

            I forgot to copy.
            I looked into Makefile.Release and realised that instead of

            C:\mysql\include
            

            this It was including this

            C:\Program Files\MySQL\MySQL Server 8.0\include
            

            I deleted qmake.stash and config.cache and repeated the qmake again and this time I generated qsqlmysql.dll successfully.
            Tested it with Sample Cpp code in Qt, it's working.
            @Christian-Ehrlicher Thanks for the suggestion.

            1 Reply Last reply
            1

            • Login

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