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. Qt MySQL Driver Mingw32-make not working
Forum Updated to NodeBB v4.3 + New Features

Qt MySQL Driver Mingw32-make not working

Scheduled Pinned Locked Moved Unsolved General and Desktop
46 Posts 6 Posters 6.1k Views 3 Watching
  • 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.
  • H Offline
    H Offline
    hobbyProgrammer
    wrote on 20 Nov 2019, 09:35 last edited by hobbyProgrammer
    #1

    I am trying to install the QMySQL driver, but it keeps giving me this error whenever I use mingw32-make.
    The previous steps in order to install the MySQL Driver were succesfull.

    Does anyone know what to do?

    C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers>mingw32-make install cd odbc\ && ( if not exist Makefile C:\Qt\5.12.5\mingw73_32\bin\qmake.exe -o Makefile C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\odbc\odbc.pro ) && mingw32-make -f Makefile install mingw32-make[1]: Entering directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc' mingw32-make -f Makefile.Release install mingw32-make[2]: Entering directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc' g++ -Wl,-s -shared -Wl,-subsystem,windows -Wl,--out-implib,C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\plugins\sqldrivers\libqsqlodbc.a -o ..\plugins\sqldrivers\qsqlodbc.dll .obj/release/qsql_odbc.o .obj/release/main.o .obj/release/moc_qsql_odbc_p.o -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib C:\Program Files (x86)\MySQL\MySQL Server 5.5\lib\libmysql.lib C:\Qt\5.12.5\mingw73_32\lib\libQt5Sql.a C:\Qt\5.12.5\mingw73_32\lib\libQt5Core.a "C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x86\odbc32.lib" .obj\release\qsqlodbc_resource_res.o g++: error: C:\Program: No such file or directory g++: error: Files: No such file or directory g++: error: (x86)\MySQL\MySQL: No such file or directory g++: error: Server: No such file or directory g++: error: 5.5\lib\libmysql.lib: No such file or directory mingw32-make[2]: *** [Makefile.Release:69: ../plugins/sqldrivers/qsqlodbc.dll] Error 1 mingw32-make[2]: Leaving directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc' mingw32-make[1]: *** [Makefile:48: release-install] Error 2 mingw32-make[1]: Leaving directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc' mingw32-make: *** [Makefile:56: sub-odbc-install_subtargets] Error 2

    J 1 Reply Last reply 20 Nov 2019, 11:11
    0
    • H hobbyProgrammer
      20 Nov 2019, 09:35

      I am trying to install the QMySQL driver, but it keeps giving me this error whenever I use mingw32-make.
      The previous steps in order to install the MySQL Driver were succesfull.

      Does anyone know what to do?

      C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers>mingw32-make install cd odbc\ && ( if not exist Makefile C:\Qt\5.12.5\mingw73_32\bin\qmake.exe -o Makefile C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\odbc\odbc.pro ) && mingw32-make -f Makefile install mingw32-make[1]: Entering directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc' mingw32-make -f Makefile.Release install mingw32-make[2]: Entering directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc' g++ -Wl,-s -shared -Wl,-subsystem,windows -Wl,--out-implib,C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\plugins\sqldrivers\libqsqlodbc.a -o ..\plugins\sqldrivers\qsqlodbc.dll .obj/release/qsql_odbc.o .obj/release/main.o .obj/release/moc_qsql_odbc_p.o -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib C:\Program Files (x86)\MySQL\MySQL Server 5.5\lib\libmysql.lib C:\Qt\5.12.5\mingw73_32\lib\libQt5Sql.a C:\Qt\5.12.5\mingw73_32\lib\libQt5Core.a "C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x86\odbc32.lib" .obj\release\qsqlodbc_resource_res.o g++: error: C:\Program: No such file or directory g++: error: Files: No such file or directory g++: error: (x86)\MySQL\MySQL: No such file or directory g++: error: Server: No such file or directory g++: error: 5.5\lib\libmysql.lib: No such file or directory mingw32-make[2]: *** [Makefile.Release:69: ../plugins/sqldrivers/qsqlodbc.dll] Error 1 mingw32-make[2]: Leaving directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc' mingw32-make[1]: *** [Makefile:48: release-install] Error 2 mingw32-make[1]: Leaving directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc' mingw32-make: *** [Makefile:56: sub-odbc-install_subtargets] Error 2

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 20 Nov 2019, 11:11 last edited by
      #2

      @hobbyProgrammer said in Qt MySQL Driver Mingw32-make not working:

      error: (x86)\MySQL\MySQL: No such file or directory

      You installed MySQL stuff in a directory containing spaces. You should avoid this as it can cause issues (like in your case). Install it in a directory without spaces and try again.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      H 1 Reply Last reply 20 Nov 2019, 11:40
      4
      • J jsulm
        20 Nov 2019, 11:11

        @hobbyProgrammer said in Qt MySQL Driver Mingw32-make not working:

        error: (x86)\MySQL\MySQL: No such file or directory

        You installed MySQL stuff in a directory containing spaces. You should avoid this as it can cause issues (like in your case). Install it in a directory without spaces and try again.

        H Offline
        H Offline
        hobbyProgrammer
        wrote on 20 Nov 2019, 11:40 last edited by hobbyProgrammer
        #3

        @jsulm so I should re-install the entire mysql workbench and server?

        J 1 Reply Last reply 20 Nov 2019, 11:41
        0
        • H hobbyProgrammer
          20 Nov 2019, 11:40

          @jsulm so I should re-install the entire mysql workbench and server?

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 20 Nov 2019, 11:41 last edited by
          #4

          @hobbyProgrammer Workbench I think (I think this one contains the client libs)

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          H 1 Reply Last reply 20 Nov 2019, 11:46
          0
          • J jsulm
            20 Nov 2019, 11:41

            @hobbyProgrammer Workbench I think (I think this one contains the client libs)

            H Offline
            H Offline
            hobbyProgrammer
            wrote on 20 Nov 2019, 11:46 last edited by
            #5

            @jsulm
            I already noticed that it went wrong with the spaces, but I was hoping that there was a simple solution for this instead of reinstalling the entire mysql workbench/server.

            But I'll give it a try as I am desperate to get this connection working

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 20 Nov 2019, 12:24 last edited by
              #6

              @hobbyProgrammer said in Qt MySQL Driver Mingw32-make not working:

              reinstalling the entire mysql workbench/server.

              why? Moving the two needed directories to somewhere else should be enough.

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

              H 2 Replies Last reply 20 Nov 2019, 12:28
              2
              • C Christian Ehrlicher
                20 Nov 2019, 12:24

                @hobbyProgrammer said in Qt MySQL Driver Mingw32-make not working:

                reinstalling the entire mysql workbench/server.

                why? Moving the two needed directories to somewhere else should be enough.

                H Offline
                H Offline
                hobbyProgrammer
                wrote on 20 Nov 2019, 12:28 last edited by
                #7

                @Christian-Ehrlicher I can just make a new folder without spaces and move all the files to there?

                1 Reply Last reply
                0
                • C Christian Ehrlicher
                  20 Nov 2019, 12:24

                  @hobbyProgrammer said in Qt MySQL Driver Mingw32-make not working:

                  reinstalling the entire mysql workbench/server.

                  why? Moving the two needed directories to somewhere else should be enough.

                  H Offline
                  H Offline
                  hobbyProgrammer
                  wrote on 20 Nov 2019, 13:09 last edited by hobbyProgrammer
                  #8

                  @Christian-Ehrlicher @Christian-Ehrlicher I moved it and used this command (from this tutorial:

                  cd C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers
                  qmake -- MYSQL_INCDIR=C:\MySQL\include "MYSQL_LIBDIR=C:\MySQL\lib"
                  mingw32-make 
                  

                  but still get the same errors..

                  J 2 Replies Last reply 20 Nov 2019, 13:11
                  0
                  • H hobbyProgrammer
                    20 Nov 2019, 13:09

                    @Christian-Ehrlicher @Christian-Ehrlicher I moved it and used this command (from this tutorial:

                    cd C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers
                    qmake -- MYSQL_INCDIR=C:\MySQL\include "MYSQL_LIBDIR=C:\MySQL\lib"
                    mingw32-make 
                    

                    but still get the same errors..

                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 20 Nov 2019, 13:11 last edited by
                    #9

                    @hobbyProgrammer Do a clean rebuild

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    H 1 Reply Last reply 20 Nov 2019, 13:15
                    1
                    • J jsulm
                      20 Nov 2019, 13:11

                      @hobbyProgrammer Do a clean rebuild

                      H Offline
                      H Offline
                      hobbyProgrammer
                      wrote on 20 Nov 2019, 13:15 last edited by
                      #10

                      @jsulm still results in getting the same error. I should rebuild sqldrivers.pro right?

                      1 Reply Last reply
                      0
                      • H hobbyProgrammer
                        20 Nov 2019, 13:09

                        @Christian-Ehrlicher @Christian-Ehrlicher I moved it and used this command (from this tutorial:

                        cd C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers
                        qmake -- MYSQL_INCDIR=C:\MySQL\include "MYSQL_LIBDIR=C:\MySQL\lib"
                        mingw32-make 
                        

                        but still get the same errors..

                        J Offline
                        J Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on 20 Nov 2019, 13:18 last edited by
                        #11

                        @hobbyProgrammer said in Qt MySQL Driver Mingw32-make not working:

                        cd C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers

                        You're doing in source build which is bad.
                        Make sure there are no build artefacts.

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        H 1 Reply Last reply 20 Nov 2019, 13:21
                        0
                        • J jsulm
                          20 Nov 2019, 13:18

                          @hobbyProgrammer said in Qt MySQL Driver Mingw32-make not working:

                          cd C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers

                          You're doing in source build which is bad.
                          Make sure there are no build artefacts.

                          H Offline
                          H Offline
                          hobbyProgrammer
                          wrote on 20 Nov 2019, 13:21 last edited by
                          #12

                          @jsulm why is that bad? I'm quite new and just following the instructions from the docs, so I'd like to learn how to do things properly :')

                          J 1 Reply Last reply 20 Nov 2019, 13:31
                          0
                          • H hobbyProgrammer
                            20 Nov 2019, 13:21

                            @jsulm why is that bad? I'm quite new and just following the instructions from the docs, so I'd like to learn how to do things properly :')

                            J Offline
                            J Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 20 Nov 2019, 13:31 last edited by jsulm
                            #13

                            @hobbyProgrammer said in Qt MySQL Driver Mingw32-make not working:

                            why is that bad?

                            Because you're polluting source tree with build artefacts. If you then want to do a clean rebuild you need to delete all build artefacts and there can be many of them all over the place. Out of source builds are way easier:

                            1. Create a build directory
                            2. Go to that directory
                            3. qmake
                            4. make
                            5. make install

                            For a clean rebuild delete everything inside build directory (or delete it and create again) and repeat steps 2..5.

                            By the way: QtCreator does out of source builds by default, so your source tree is clean and it's easier to use version control systems like Git :-)

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            H 1 Reply Last reply 20 Nov 2019, 13:55
                            0
                            • J jsulm
                              20 Nov 2019, 13:31

                              @hobbyProgrammer said in Qt MySQL Driver Mingw32-make not working:

                              why is that bad?

                              Because you're polluting source tree with build artefacts. If you then want to do a clean rebuild you need to delete all build artefacts and there can be many of them all over the place. Out of source builds are way easier:

                              1. Create a build directory
                              2. Go to that directory
                              3. qmake
                              4. make
                              5. make install

                              For a clean rebuild delete everything inside build directory (or delete it and create again) and repeat steps 2..5.

                              By the way: QtCreator does out of source builds by default, so your source tree is clean and it's easier to use version control systems like Git :-)

                              H Offline
                              H Offline
                              hobbyProgrammer
                              wrote on 20 Nov 2019, 13:55 last edited by
                              #14

                              @jsulm Thank you for your answer. I'm gonna retry to make the driver with this information in mind.

                              1 Reply Last reply
                              0
                              • H Offline
                                H Offline
                                hobbyProgrammer
                                wrote on 27 Nov 2019, 18:49 last edited by
                                #15

                                I still did not get it to work.

                                What I did:

                                1. Moved all the content from MySQL server directory (contained a lot of spaced) to C:/MySQL.
                                2. Used these commands:
                                cd C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers
                                qmake -- MYSQL_INCDIR=:C\MySQL\include "MYSQL_LIBDIR=C:\MySQL\lib"
                                mingw32-make 
                                

                                yet it still doesn't work. Is there anyone who knows why and can help me? I really want to connect to my MySQL database..

                                1 Reply Last reply
                                0
                                • C Offline
                                  C Offline
                                  Christian Ehrlicher
                                  Lifetime Qt Champion
                                  wrote on 27 Nov 2019, 19:01 last edited by
                                  #16

                                  @hobbyProgrammer said in Qt MySQL Driver Mingw32-make not working:

                                  MYSQL_INCDIR=:C\MySQL\include

                                  typo?

                                  What was the output of the qmake command?

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

                                  1 Reply Last reply
                                  2
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 27 Nov 2019, 19:01 last edited by
                                    #17

                                    You have the : before the C. Is this just a typo here ?

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    H 1 Reply Last reply 28 Nov 2019, 07:55
                                    1
                                    • SGaistS SGaist
                                      27 Nov 2019, 19:01

                                      You have the : before the C. Is this just a typo here ?

                                      H Offline
                                      H Offline
                                      hobbyProgrammer
                                      wrote on 28 Nov 2019, 07:55 last edited by hobbyProgrammer
                                      #18

                                      @Christian-Ehrlicher @SGaist
                                      yes that was a typo, but the output stays the same: "Project ERROR: Could not find feature sql-mysql."

                                      1 Reply Last reply
                                      0
                                      • C Offline
                                        C Offline
                                        Christian Ehrlicher
                                        Lifetime Qt Champion
                                        wrote on 28 Nov 2019, 08:00 last edited by
                                        #19

                                        That's not the complete output. Please remove all intermediate files create by qmake (run first 'make distclean', then also remove qmake.cache) and rerun qmake again with the correct mysql parameters. Then show us the output.

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

                                        H 1 Reply Last reply 28 Nov 2019, 08:06
                                        2
                                        • C Christian Ehrlicher
                                          28 Nov 2019, 08:00

                                          That's not the complete output. Please remove all intermediate files create by qmake (run first 'make distclean', then also remove qmake.cache) and rerun qmake again with the correct mysql parameters. Then show us the output.

                                          H Offline
                                          H Offline
                                          hobbyProgrammer
                                          wrote on 28 Nov 2019, 08:06 last edited by
                                          #20

                                          @Christian-Ehrlicher right now this is my output:

                                          C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR=C:\MySQL\include "MYSQL_LIBDIR=C:\MySQL\lib"

                                          Running configuration tests...
                                          Done running configuration tests.

                                          Configure summary:

                                          Qt Sql Drivers:
                                          DB2 (IBM) .............................. no
                                          InterBase .............................. no
                                          MySql .................................. no
                                          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 'mingw32-make'.
                                          Once everything is built, you must run 'mingw32-make install'.
                                          Qt will be installed into 'C:\Qt\5.12.5\mingw73_32'.

                                          Prior to reconfiguration, make sure you remove any leftovers from
                                          the previous build.

                                          Then I ran mingw32-make:

                                          C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers>mingw32-make
                                          cd odbc\ && ( if not exist Makefile C:\Qt\5.12.5\mingw73_32\bin\qmake.exe -o Makefile C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\odbc\odbc.pro ) && mingw32-make -f Makefile
                                          mingw32-make[1]: Entering directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc'
                                          mingw32-make -f Makefile.Release all
                                          mingw32-make[2]: Entering directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc'
                                          mingw32-make[2]: Nothing to be done for 'all'.
                                          mingw32-make[2]: Leaving directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc'
                                          mingw32-make -f Makefile.Debug all
                                          mingw32-make[2]: Entering directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc'
                                          mingw32-make[2]: Nothing to be done for 'all'.
                                          mingw32-make[2]: Leaving directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc'
                                          mingw32-make[1]: Leaving directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/odbc'
                                          cd sqlite\ && ( if not exist Makefile C:\Qt\5.12.5\mingw73_32\bin\qmake.exe -o Makefile C:\Qt\5.12.5\Src\qtbase\src\plugins\sqldrivers\sqlite\sqlite.pro ) && mingw32-make -f Makefile
                                          mingw32-make[1]: Entering directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/sqlite'
                                          mingw32-make -f Makefile.Release all
                                          mingw32-make[2]: Entering directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/sqlite'
                                          mingw32-make[2]: Nothing to be done for 'all'.
                                          mingw32-make[2]: Leaving directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/sqlite'
                                          mingw32-make -f Makefile.Debug all
                                          mingw32-make[2]: Entering directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/sqlite'
                                          mingw32-make[2]: Nothing to be done for 'all'.
                                          mingw32-make[2]: Leaving directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/sqlite'
                                          mingw32-make[1]: Leaving directory 'C:/Qt/5.12.5/Src/qtbase/src/plugins/sqldrivers/sqlite'

                                          1 Reply Last reply
                                          0

                                          • Login

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