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. Can't build the MySQL drivers
QtWS25 Last Chance

Can't build the MySQL drivers

Scheduled Pinned Locked Moved Solved General and Desktop
mysqldrivererror
13 Posts 3 Posters 3.7k 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.
  • A Offline
    A Offline
    AlanT1337
    wrote on 8 Mar 2016, 19:27 last edited by
    #1

    I'm trying to build the MySQL drivers for Qt. I've downloaded and installed the MySQL Server files and I also got the Qt source files. After that i've tried to build the MySQL plugin, by opening the MySQL pro file (located at Qtbase/src/plugins/sqldrivers/mysql) and I've add path to the MySQL Server files (include and lib). When I now try to build it, I get the error "cannot open file 'mysql.lib'". So I checked if there is a mysql.lib file in the MySQL Server lib path and there wasnt, so I downloaded the C++ MySQL connector, but it doesnt contain a mysql.lib file either. So I need help, I'm not sure if I'm doing it right and if so, where can I get the mysql.lib file?

    Thanks for all the help

    Greets Steven

    K 1 Reply Last reply 8 Mar 2016, 21:23
    0
    • A AlanT1337
      8 Mar 2016, 19:27

      I'm trying to build the MySQL drivers for Qt. I've downloaded and installed the MySQL Server files and I also got the Qt source files. After that i've tried to build the MySQL plugin, by opening the MySQL pro file (located at Qtbase/src/plugins/sqldrivers/mysql) and I've add path to the MySQL Server files (include and lib). When I now try to build it, I get the error "cannot open file 'mysql.lib'". So I checked if there is a mysql.lib file in the MySQL Server lib path and there wasnt, so I downloaded the C++ MySQL connector, but it doesnt contain a mysql.lib file either. So I need help, I'm not sure if I'm doing it right and if so, where can I get the mysql.lib file?

      Thanks for all the help

      Greets Steven

      K Offline
      K Offline
      kshegunov
      Moderators
      wrote on 8 Mar 2016, 21:23 last edited by
      #2

      @AlanT1337
      Hello,
      You either get an SDK for the mysql client library that includes the .lib or you build it yourself. No matter what kind of connectors or other runtimes you download, they wouldn't include the import library (as MS calls it) because they're not a development package (which you need).

      Kind regards.

      Read and abide by the Qt Code of Conduct

      A 1 Reply Last reply 9 Mar 2016, 16:44
      0
      • K kshegunov
        8 Mar 2016, 21:23

        @AlanT1337
        Hello,
        You either get an SDK for the mysql client library that includes the .lib or you build it yourself. No matter what kind of connectors or other runtimes you download, they wouldn't include the import library (as MS calls it) because they're not a development package (which you need).

        Kind regards.

        A Offline
        A Offline
        AlanT1337
        wrote on 9 Mar 2016, 16:44 last edited by AlanT1337 3 Sept 2016, 17:37
        #3

        @kshegunov Thanks for the reply. As far as i know, the MySQL Server source and the MySQL C++ Connector conatin all the needed libraries. Also, there is no other official SDK for MySQL. That's why I'm so confused, because nobody has ever heard of an "mysql.lib" they all only have the "libmysql.lib" file included.

        This takes me over 3 days now already... I need help really badly, since I got no clue what I have to do. I would really appreciate if somebody has 5-10 minutes to help me.

        K 1 Reply Last reply 9 Mar 2016, 22:41
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 9 Mar 2016, 21:32 last edited by
          #4

          Hi and welcome to devnet,

          Did you modify the plugin .pro file ?

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

          A 1 Reply Last reply 10 Mar 2016, 12:07
          0
          • A AlanT1337
            9 Mar 2016, 16:44

            @kshegunov Thanks for the reply. As far as i know, the MySQL Server source and the MySQL C++ Connector conatin all the needed libraries. Also, there is no other official SDK for MySQL. That's why I'm so confused, because nobody has ever heard of an "mysql.lib" they all only have the "libmysql.lib" file included.

            This takes me over 3 days now already... I need help really badly, since I got no clue what I have to do. I would really appreciate if somebody has 5-10 minutes to help me.

            K Offline
            K Offline
            kshegunov
            Moderators
            wrote on 9 Mar 2016, 22:41 last edited by
            #5

            @AlanT1337

            That's why I'm so confused, because nobody has ever heard of an "mysql.lib" they all only have the "libmysql.lib" file included.

            Well, this is it! In the end you have the lib file, the only problem seems to be still on the table is that the linker looks for the wrong one. To join @SGaist:

            Did you modify the plugin .pro file ?

            Kind regards.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            0
            • S SGaist
              9 Mar 2016, 21:32

              Hi and welcome to devnet,

              Did you modify the plugin .pro file ?

              A Offline
              A Offline
              AlanT1337
              wrote on 10 Mar 2016, 12:07 last edited by AlanT1337 3 Oct 2016, 12:30
              #6

              @SGaist
              Hey, thanks for the response. Yes I did modify it, I followed a tutorial. Now I've downloaded it again and I did not modify it and tried to build it. It first gave me the error that it can't find the mysql.h file, so I've add the Includepath to it. Now I get the error "cannot find -libmysql", even if I add the correct library path. :(

              Hope somebody can help me! :)

              EDIT: I copied the libmysql.lib into the compiler path. Now it builds succesfully but it does not create the needed dll files... Still need help :c

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 10 Mar 2016, 12:17 last edited by
                #7

                Did you add something like:

                LIBS += -LC:/Path/To/MySQL/Folder/Where/.lib_file/Can/Be/Found
                

                ?

                On a side note, if the path contains spaces, then you might get into trouble (Windows always gave trouble with paths containing spaces). If so either move your MySQL install (or just the header and lib file) in a path without space or use the 8.3 notation. (I recommend the first solution)

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

                A 1 Reply Last reply 10 Mar 2016, 12:30
                1
                • S SGaist
                  10 Mar 2016, 12:17

                  Did you add something like:

                  LIBS += -LC:/Path/To/MySQL/Folder/Where/.lib_file/Can/Be/Found
                  

                  ?

                  On a side note, if the path contains spaces, then you might get into trouble (Windows always gave trouble with paths containing spaces). If so either move your MySQL install (or just the header and lib file) in a path without space or use the 8.3 notation. (I recommend the first solution)

                  A Offline
                  A Offline
                  AlanT1337
                  wrote on 10 Mar 2016, 12:30 last edited by
                  #8

                  @SGaist I copied the libmysql.lib into the compiler path. Now it builds succesfully but it does not create the needed dll files... Still need help :c

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 10 Mar 2016, 12:35 last edited by
                    #9

                    Where did you check their existence ?

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

                    A 1 Reply Last reply 10 Mar 2016, 12:37
                    0
                    • S SGaist
                      10 Mar 2016, 12:35

                      Where did you check their existence ?

                      A Offline
                      A Offline
                      AlanT1337
                      wrote on 10 Mar 2016, 12:37 last edited by
                      #10

                      @SGaist In the build directory that was created in "...qtbase\src\plugins\sqldrivers\build-mysql-Desktop_Qt_5_5_1_MinGW_32bit-Debug"

                      K 1 Reply Last reply 10 Mar 2016, 12:44
                      0
                      • A AlanT1337
                        10 Mar 2016, 12:37

                        @SGaist In the build directory that was created in "...qtbase\src\plugins\sqldrivers\build-mysql-Desktop_Qt_5_5_1_MinGW_32bit-Debug"

                        K Offline
                        K Offline
                        kshegunov
                        Moderators
                        wrote on 10 Mar 2016, 12:44 last edited by kshegunov 3 Oct 2016, 12:44
                        #11

                        @AlanT1337
                        Well, this sounds like a intermediate dir created by Qt creator, look up the plugins directory. When I build Qt I get the plugins' binaries in qtbase/plugins/ (although I do it from the command line).

                        Read and abide by the Qt Code of Conduct

                        A 1 Reply Last reply 10 Mar 2016, 12:53
                        0
                        • K kshegunov
                          10 Mar 2016, 12:44

                          @AlanT1337
                          Well, this sounds like a intermediate dir created by Qt creator, look up the plugins directory. When I build Qt I get the plugins' binaries in qtbase/plugins/ (although I do it from the command line).

                          A Offline
                          A Offline
                          AlanT1337
                          wrote on 10 Mar 2016, 12:53 last edited by AlanT1337 3 Oct 2016, 13:02
                          #12

                          @kshegunov I dont have a "plugins" folder in my "qtbase" directory D:

                          Edit: I think it was build in my normal Qt folder in "C:\Qt\5.5\msvc2013\plugins\sqldrivers", if I pick the msv2013 32bit compiler now for the project I need the driver for, then it works!!! Thanks sooooooooo much to everyone who helped me!!!! :)

                          K 1 Reply Last reply 10 Mar 2016, 13:02
                          0
                          • A AlanT1337
                            10 Mar 2016, 12:53

                            @kshegunov I dont have a "plugins" folder in my "qtbase" directory D:

                            Edit: I think it was build in my normal Qt folder in "C:\Qt\5.5\msvc2013\plugins\sqldrivers", if I pick the msv2013 32bit compiler now for the project I need the driver for, then it works!!! Thanks sooooooooo much to everyone who helped me!!!! :)

                            K Offline
                            K Offline
                            kshegunov
                            Moderators
                            wrote on 10 Mar 2016, 13:02 last edited by kshegunov 3 Oct 2016, 13:02
                            #13

                            @AlanT1337 said:

                            I think it was build in my normal Qt folder

                            I suppose that's possible, if you're using the qmake from that location to run on the project file. In any case I'm glad it's working now.

                            Read and abide by the Qt Code of Conduct

                            1 Reply Last reply
                            0

                            1/13

                            8 Mar 2016, 19:27

                            • Login

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