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. QMYSQL driver not found Qt 6.5.1, I've tried all I found online, without success
Forum Updated to NodeBB v4.3 + New Features

QMYSQL driver not found Qt 6.5.1, I've tried all I found online, without success

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmysql
69 Posts 7 Posters 14.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.
  • J JonB
    30 Jun 2023, 08:40

    @cpplegend said in QMYSQL driver not found Qt 6.5.1, I've tried all I found online, without success:

    it said that those are incompatible...

    Did you do anything about my suggestion that a Debug version of the DLL may not be acceptable/loadable and you should try a Release version?

    Otherwise you might copy & paste the actual message rather than telling us "it said that those are incompatible...".

    C Offline
    C Offline
    cpplegend
    wrote on 30 Jun 2023, 09:07 last edited by
    #54

    @JonB I didn't try to make a release Version, how can I do it? I didn't share what the Debug Window says because I cannot use my computer now, my room is occupied (I am 17 yo)

    1 Reply Last reply
    0
    • J JonB
      30 Jun 2023, 08:40

      @cpplegend said in QMYSQL driver not found Qt 6.5.1, I've tried all I found online, without success:

      it said that those are incompatible...

      Did you do anything about my suggestion that a Debug version of the DLL may not be acceptable/loadable and you should try a Release version?

      Otherwise you might copy & paste the actual message rather than telling us "it said that those are incompatible...".

      C Offline
      C Offline
      cpplegend
      wrote on 30 Jun 2023, 10:44 last edited by
      #55

      @JonB hei so how do I build the release version?

      J 1 Reply Last reply 30 Jun 2023, 10:56
      0
      • C cpplegend
        30 Jun 2023, 10:44

        @JonB hei so how do I build the release version?

        J Online
        J Online
        JonB
        wrote on 30 Jun 2023, 10:56 last edited by JonB
        #56

        @cpplegend
        Some things you are really supposed to figure for yourself. Or if necessary look up in Help. In Creator you choose which configuration to build. You apparently currently have it on "Debug". You should change that to "Release" and rebuild. Note that the resulting DLL will no longer be in the .../x64/Debug/sqldrivers directory used when building for debug, if you need to copy the built file(s) you will need to copy from the new location.

        C 1 Reply Last reply 30 Jun 2023, 14:50
        1
        • C cpplegend
          30 Jun 2023, 07:45

          @Christian-Ehrlicher I have seen it, it is in the plugin folder, plugin folder is in the mingw folder...I also tried to put the sqldrivers folder into: C:\Users\ianno\OneDrive\Desktop\QTProjects\PROVE\imageDB_provaDiConnessione\x64\Debug\sqldrivers... I have in this folder these files:
          "qsqlite.debug"
          "qsqlite.dll"
          "qsqlmysql.debug"
          "qsqlmysql.dll"
          "qsqlodbc.debug"
          "qsqlodbc.dll"

          I simply don't understand what I should do, could you explain the right process? I know I am boring I have been asking here for days..but I really need to understand

          T Offline
          T Offline
          thecodemonkey
          wrote on 30 Jun 2023, 14:38 last edited by
          #57

          @cpplegend on the one hand you have posted a list of plugins plugins that clearly are in MinGW format (telling from .debug file extension), but on the other hand you posted paths containing msvc2019_64. You need to use the correct plugins for the compiler you use

          1 Reply Last reply
          0
          • J JonB
            30 Jun 2023, 10:56

            @cpplegend
            Some things you are really supposed to figure for yourself. Or if necessary look up in Help. In Creator you choose which configuration to build. You apparently currently have it on "Debug". You should change that to "Release" and rebuild. Note that the resulting DLL will no longer be in the .../x64/Debug/sqldrivers directory used when building for debug, if you need to copy the built file(s) you will need to copy from the new location.

            C Offline
            C Offline
            cpplegend
            wrote on 30 Jun 2023, 14:50 last edited by
            #58

            @JonB @thecodemonkey I really feel so stupid when you talk you obviously know more on this topic than me, please could you explain what I have to do because I am not understanding anything. what should I do now? should I download any other file? I am really sick of this plugin but I need to understand... I know I am boring, I always say the same thing, but it's because I don't understand, it's so difficult..if it is just coding I learn pretty fast, but these things are new to me

            T 1 Reply Last reply 30 Jun 2023, 16:44
            0
            • C cpplegend
              30 Jun 2023, 14:50

              @JonB @thecodemonkey I really feel so stupid when you talk you obviously know more on this topic than me, please could you explain what I have to do because I am not understanding anything. what should I do now? should I download any other file? I am really sick of this plugin but I need to understand... I know I am boring, I always say the same thing, but it's because I don't understand, it's so difficult..if it is just coding I learn pretty fast, but these things are new to me

              T Offline
              T Offline
              thecodemonkey
              wrote on 30 Jun 2023, 16:44 last edited by thecodemonkey
              #59

              @cpplegend you can use different C++ compilers with Qt. On Windows by default these are Microsoft Visual C++ or MinGW. During Installation in Qt maintenance tool you choose if you install the Qt version for MSVC or for MinGW (or both):

              fa1e2c03-d495-45ea-85bd-8831ed0c71cc-image.png .

              If you are a beginner, I recommend to install only one of them to avoid confusion. In Qt Creator under "Projects" you should be able to see, which Qt version is used for the current project:

              272e89bf-4d81-40f4-bc68-118e2dbb7dbf-image.png

              depending on that, you need to copy the correct qsqlmysql.dll (plus libmysql.dll):

              If it's MSVC2019 then for example copy the files from https://github.com/thecodemonkey86/qt_mysql_driver/files/11768056/qsqlmysql.dll_Qt_SQL_driver_6.5.1_MSVC2019_64-bit.zip,

              if MinGW then the files from https://github.com/thecodemonkey86/qt_mysql_driver/files/11768059/qsqlmysql.dll_Qt_SQL_driver_6.5.1_MinGW_11.2.0_64-bit.zip

              to sqldrivers folder and application folder respectively

              C 1 Reply Last reply 30 Jun 2023, 17:06
              0
              • T thecodemonkey
                30 Jun 2023, 16:44

                @cpplegend you can use different C++ compilers with Qt. On Windows by default these are Microsoft Visual C++ or MinGW. During Installation in Qt maintenance tool you choose if you install the Qt version for MSVC or for MinGW (or both):

                fa1e2c03-d495-45ea-85bd-8831ed0c71cc-image.png .

                If you are a beginner, I recommend to install only one of them to avoid confusion. In Qt Creator under "Projects" you should be able to see, which Qt version is used for the current project:

                272e89bf-4d81-40f4-bc68-118e2dbb7dbf-image.png

                depending on that, you need to copy the correct qsqlmysql.dll (plus libmysql.dll):

                If it's MSVC2019 then for example copy the files from https://github.com/thecodemonkey86/qt_mysql_driver/files/11768056/qsqlmysql.dll_Qt_SQL_driver_6.5.1_MSVC2019_64-bit.zip,

                if MinGW then the files from https://github.com/thecodemonkey86/qt_mysql_driver/files/11768059/qsqlmysql.dll_Qt_SQL_driver_6.5.1_MinGW_11.2.0_64-bit.zip

                to sqldrivers folder and application folder respectively

                C Offline
                C Offline
                cpplegend
                wrote on 30 Jun 2023, 17:06 last edited by
                #60

                @thecodemonkey sqldrivers from plugin folder in src from qtbase folder, right? and then as you Said the Application folder of the Project I am creating, is it right?

                T 1 Reply Last reply 30 Jun 2023, 17:15
                0
                • C cpplegend
                  30 Jun 2023, 17:06

                  @thecodemonkey sqldrivers from plugin folder in src from qtbase folder, right? and then as you Said the Application folder of the Project I am creating, is it right?

                  T Offline
                  T Offline
                  thecodemonkey
                  wrote on 30 Jun 2023, 17:15 last edited by thecodemonkey
                  #61

                  @cpplegend by application folder I mean the folder, where the compiler creates the .exe file of your project, like this:
                  bbc12c36-2a8b-4199-b343-75d54956cb65-image.png

                  the sqldrivers folder can be either a subdirectory of the application folder (like this:
                  69b60ef9-894c-4a95-9862-b89b20a7c2c1-image.png

                  ) ,or in the installation binary folder of Qt. On my system that would be for
                  MSVC: C:\Qt\6.5.1\msvc2019_64\plugins\sqldrivers (and for MinGW: C:\Qt\6.5.1\mingw_64\plugins\sqldrivers)

                  both options (application folder and installation folder) should work

                  C 2 Replies Last reply 30 Jun 2023, 17:42
                  0
                  • T thecodemonkey
                    30 Jun 2023, 17:15

                    @cpplegend by application folder I mean the folder, where the compiler creates the .exe file of your project, like this:
                    bbc12c36-2a8b-4199-b343-75d54956cb65-image.png

                    the sqldrivers folder can be either a subdirectory of the application folder (like this:
                    69b60ef9-894c-4a95-9862-b89b20a7c2c1-image.png

                    ) ,or in the installation binary folder of Qt. On my system that would be for
                    MSVC: C:\Qt\6.5.1\msvc2019_64\plugins\sqldrivers (and for MinGW: C:\Qt\6.5.1\mingw_64\plugins\sqldrivers)

                    both options (application folder and installation folder) should work

                    C Offline
                    C Offline
                    cpplegend
                    wrote on 30 Jun 2023, 17:42 last edited by
                    #62

                    @thecodemonkey ok when I return home I will try

                    1 Reply Last reply
                    0
                    • T thecodemonkey
                      30 Jun 2023, 17:15

                      @cpplegend by application folder I mean the folder, where the compiler creates the .exe file of your project, like this:
                      bbc12c36-2a8b-4199-b343-75d54956cb65-image.png

                      the sqldrivers folder can be either a subdirectory of the application folder (like this:
                      69b60ef9-894c-4a95-9862-b89b20a7c2c1-image.png

                      ) ,or in the installation binary folder of Qt. On my system that would be for
                      MSVC: C:\Qt\6.5.1\msvc2019_64\plugins\sqldrivers (and for MinGW: C:\Qt\6.5.1\mingw_64\plugins\sqldrivers)

                      both options (application folder and installation folder) should work

                      C Offline
                      C Offline
                      cpplegend
                      wrote on 30 Jun 2023, 20:12 last edited by
                      #63

                      @thecodemonkey now when I include the QSqlDatabase header file these errors occures: :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x3b): undefined reference to __imp__ZN12QSqlDatabaseD1Ev' :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x8b): undefined reference to __imp__ZN12QSqlDatabaseD1Ev'
                      :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0xef): undefined reference to __imp__ZN12QSqlDatabaseD1Ev' :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x14f): undefined reference to __imp__ZN12QSqlDatabaseD1Ev'
                      :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x1a9): undefined reference to __imp__ZN12QSqlDatabaseC1Ev' :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x1ee): undefined reference to __imp__ZN12QSqlDatabaseD1Ev'
                      :-1: error: collect2.exe: error: ld returned 1 exit status
                      :-1: error: ninja: build stopped: subcommand failed.

                      T J 2 Replies Last reply 1 Jul 2023, 07:25
                      0
                      • C cpplegend
                        30 Jun 2023, 20:12

                        @thecodemonkey now when I include the QSqlDatabase header file these errors occures: :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x3b): undefined reference to __imp__ZN12QSqlDatabaseD1Ev' :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x8b): undefined reference to __imp__ZN12QSqlDatabaseD1Ev'
                        :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0xef): undefined reference to __imp__ZN12QSqlDatabaseD1Ev' :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x14f): undefined reference to __imp__ZN12QSqlDatabaseD1Ev'
                        :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x1a9): undefined reference to __imp__ZN12QSqlDatabaseC1Ev' :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x1ee): undefined reference to __imp__ZN12QSqlDatabaseD1Ev'
                        :-1: error: collect2.exe: error: ld returned 1 exit status
                        :-1: error: ninja: build stopped: subcommand failed.

                        T Offline
                        T Offline
                        thecodemonkey
                        wrote on 1 Jul 2023, 07:25 last edited by
                        #64

                        @cpplegend Did you link the Sql module in CMakeLists ?

                        C 1 Reply Last reply 1 Jul 2023, 09:59
                        0
                        • C cpplegend
                          30 Jun 2023, 20:12

                          @thecodemonkey now when I include the QSqlDatabase header file these errors occures: :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x3b): undefined reference to __imp__ZN12QSqlDatabaseD1Ev' :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x8b): undefined reference to __imp__ZN12QSqlDatabaseD1Ev'
                          :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0xef): undefined reference to __imp__ZN12QSqlDatabaseD1Ev' :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x14f): undefined reference to __imp__ZN12QSqlDatabaseD1Ev'
                          :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x1a9): undefined reference to __imp__ZN12QSqlDatabaseC1Ev' :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x1ee): undefined reference to __imp__ZN12QSqlDatabaseD1Ev'
                          :-1: error: collect2.exe: error: ld returned 1 exit status
                          :-1: error: ninja: build stopped: subcommand failed.

                          J Online
                          J Online
                          JonB
                          wrote on 1 Jul 2023, 08:39 last edited by JonB 7 Jan 2023, 08:48
                          #65

                          @cpplegend
                          If I am not mistaken:

                          :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x3b): undefined reference to __imp__ZN12QSqlDatabaseD1Ev'

                          widget.cpp.obj indicates this has been compiled with MSVC (MSVC does .obj files, MinGW does .o) and __imp__ZN12QSqlDatabaseD1Ev leading __imp_ also indicates MSVC rather than MinGW. [Also if you really have a file named widget.cpp.obj somewhere per the error message that is wrong, MSVC should be generating widget.obj from widget.cpp, but that's another matter.]

                          :-1: error: collect2.exe: error: ld returned 1 exit status

                          collect2/ld indicates MinGW linker.

                          (Assuming I am right) You really need to sort out whether you are using MSVC or MinGW once and for all, and make it consistent....

                          C 1 Reply Last reply 1 Jul 2023, 09:40
                          0
                          • J JonB
                            1 Jul 2023, 08:39

                            @cpplegend
                            If I am not mistaken:

                            :-1: error: CMakeFiles/untitled1.dir/widget.cpp.obj:widget.cpp:(.text+0x3b): undefined reference to __imp__ZN12QSqlDatabaseD1Ev'

                            widget.cpp.obj indicates this has been compiled with MSVC (MSVC does .obj files, MinGW does .o) and __imp__ZN12QSqlDatabaseD1Ev leading __imp_ also indicates MSVC rather than MinGW. [Also if you really have a file named widget.cpp.obj somewhere per the error message that is wrong, MSVC should be generating widget.obj from widget.cpp, but that's another matter.]

                            :-1: error: collect2.exe: error: ld returned 1 exit status

                            collect2/ld indicates MinGW linker.

                            (Assuming I am right) You really need to sort out whether you are using MSVC or MinGW once and for all, and make it consistent....

                            C Offline
                            C Offline
                            cpplegend
                            wrote on 1 Jul 2023, 09:40 last edited by
                            #66

                            @JonB I am using mingw, I know that because its the only package I have installed between mingw and msvc

                            J 1 Reply Last reply 1 Jul 2023, 09:46
                            0
                            • C cpplegend
                              1 Jul 2023, 09:40

                              @JonB I am using mingw, I know that because its the only package I have installed between mingw and msvc

                              J Online
                              J Online
                              JonB
                              wrote on 1 Jul 2023, 09:46 last edited by
                              #67

                              @cpplegend Then what about as @thecodemonkey said?

                              1 Reply Last reply
                              0
                              • T thecodemonkey
                                1 Jul 2023, 07:25

                                @cpplegend Did you link the Sql module in CMakeLists ?

                                C Offline
                                C Offline
                                cpplegend
                                wrote on 1 Jul 2023, 09:59 last edited by cpplegend 7 Jan 2023, 10:00
                                #68

                                @thecodemonkey @JonB how do I make it?

                                T 1 Reply Last reply 1 Jul 2023, 17:24
                                0
                                • C cpplegend
                                  1 Jul 2023, 09:59

                                  @thecodemonkey @JonB how do I make it?

                                  T Offline
                                  T Offline
                                  thecodemonkey
                                  wrote on 1 Jul 2023, 17:24 last edited by
                                  #69

                                  @cpplegend maybe it gets us further if you post your project here first, incl CMakeLists.txt

                                  1 Reply Last reply
                                  0

                                  63/69

                                  30 Jun 2023, 20:12

                                  • Login

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