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 17.6k 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.
  • C cpplegend

    @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 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
    0
    • T thecodemonkey

      @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 last edited by
      #62

      @thecodemonkey ok when I return home I will try

      1 Reply Last reply
      0
      • T thecodemonkey

        @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 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 JonBJ 2 Replies Last reply
        0
        • C cpplegend

          @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 last edited by
          #64

          @cpplegend Did you link the Sql module in CMakeLists ?

          C 1 Reply Last reply
          0
          • C cpplegend

            @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.

            JonBJ Online
            JonBJ Online
            JonB
            wrote on last edited by JonB
            #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
            0
            • JonBJ JonB

              @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 last edited by
              #66

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

              JonBJ 1 Reply Last reply
              0
              • C cpplegend

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

                JonBJ Online
                JonBJ Online
                JonB
                wrote on last edited by
                #67

                @cpplegend Then what about as @thecodemonkey said?

                1 Reply Last reply
                0
                • T thecodemonkey

                  @cpplegend Did you link the Sql module in CMakeLists ?

                  C Offline
                  C Offline
                  cpplegend
                  wrote on last edited by cpplegend
                  #68

                  @thecodemonkey @JonB how do I make it?

                  T 1 Reply Last reply
                  0
                  • C cpplegend

                    @thecodemonkey @JonB how do I make it?

                    T Offline
                    T Offline
                    thecodemonkey
                    wrote on 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

                    • Login

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