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 mysql plugin for qt (c++)
Forum Updated to NodeBB v4.3 + New Features

building mysql plugin for qt (c++)

Scheduled Pinned Locked Moved Unsolved General and Desktop
26 Posts 4 Posters 3.1k Views 2 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.
  • silvio_2020S Offline
    silvio_2020S Offline
    silvio_2020
    wrote on last edited by
    #1

    Hello helpers,
    i have been searching on web for two weeks
    i am trying to build mysql plugin for qt using mingw32 and mysql server 8 and already was trying with my sql server 5.5 32 bit
    qmake "INCLUDEPATH+=C:/dev/mysql-dev/include” “LIBS+=-LC:/dev/mysql-dev/lib -libmysql” mysql.pro mingw32-make
    but it's printing this error : project error: mysql library was not defined
    please help me
    Qt newbie
    thanks in advance

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      This question has been already asked a lot of time on this very forum.

      The informations requested is always the same:

      • what version of Qt are you using ?

      Looking at the line you are using you don't seem to follow Qt's documentation to build the MySQL driver, are you ?

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

      silvio_2020S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        This question has been already asked a lot of time on this very forum.

        The informations requested is always the same:

        • what version of Qt are you using ?

        Looking at the line you are using you don't seem to follow Qt's documentation to build the MySQL driver, are you ?

        silvio_2020S Offline
        silvio_2020S Offline
        silvio_2020
        wrote on last edited by
        #3

        @SGaist
        i installed QT 5.12.6 but in start menu it shows QT 4.11 community
        mingw32- version is 5.12.6
        i am confused
        i followed the instruction as documentation says but no result
        thanks for replying

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @silvio_2020 said in building mysql plugin for qt (c++):

          followed the instruction as documentation says but no result

          And how should we help here? What is 'no result'? What exactly did you do and what did not work??

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

          silvio_2020S 1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            @silvio_2020 said in building mysql plugin for qt (c++):

            followed the instruction as documentation says but no result

            And how should we help here? What is 'no result'? What exactly did you do and what did not work??

            silvio_2020S Offline
            silvio_2020S Offline
            silvio_2020
            wrote on last edited by silvio_2020
            #5

            @Christian-Ehrlicher
            qmake "INCLUDEPATH+=C:/dev/mysql-dev/include” “LIBS+=-LC:/dev/mysql-dev/lib -libmysql” mysql.pro mingw32-make
            but it's printing this error : project error: mysql library was not defined
            what is wrong ?

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @silvio_2020 said in building mysql plugin for qt (c++):

              what is wrong ?

              You did not follow the instructions

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

              silvio_2020S 1 Reply Last reply
              0
              • Christian EhrlicherC Christian Ehrlicher

                @silvio_2020 said in building mysql plugin for qt (c++):

                what is wrong ?

                You did not follow the instructions

                silvio_2020S Offline
                silvio_2020S Offline
                silvio_2020
                wrote on last edited by
                #7

                @Christian-Ehrlicher
                yes
                i downloaded Qt src , Mysql server 8
                joined the libmysql.lib to mysql.pro while building
                and that's all
                but honestly Qt documentation seems unclear for some one newbie
                i tried all my possible
                can you provide more clear path ?

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  You have the exact line to use in the documentation linked by @Christian-Ehrlicher which does not match what you are currently using.

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

                  silvio_2020S 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    You have the exact line to use in the documentation linked by @Christian-Ehrlicher which does not match what you are currently using.

                    silvio_2020S Offline
                    silvio_2020S Offline
                    silvio_2020
                    wrote on last edited by
                    #9

                    @SGaist
                    i used that line of code described in the documentation but it's shows the same result
                    there is any requirement of compatibility between mysql server version (64) and qt
                    in config test it shows
                    sqlite yes
                    mysql no

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      What exact error are you getting in the logs ?

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

                      Christian EhrlicherC silvio_2020S 2 Replies Last reply
                      0
                      • SGaistS SGaist

                        What exact error are you getting in the logs ?

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

                        @SGaist said in building mysql plugin for qt (c++):

                        What exact error are you getting in the logs ?

                        And what was your command line? Did you remove config.cache in the directory before?

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

                        silvio_2020S 2 Replies Last reply
                        0
                        • SGaistS SGaist

                          What exact error are you getting in the logs ?

                          silvio_2020S Offline
                          silvio_2020S Offline
                          silvio_2020
                          wrote on last edited by
                          #12

                          @SGaist
                          i do it again with the line code described in Qt doc
                          and now it tells me that
                          qmake -- MYSQL_INCDIR=C:\dev\mysql-dev\include "MYSQL_LIBDIR=C:/dev/mysql-dev/lib/lib/libmysql.lib" mingw32-make sub-mysql

                          "no rule to make target "mingw32-make" "

                          1 Reply Last reply
                          0
                          • Christian EhrlicherC Offline
                            Christian EhrlicherC Offline
                            Christian Ehrlicher
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            These are two commands ...
                            what did
                            "qmake -- MYSQL_INCDIR=C:\dev\mysql-dev\include "MYSQL_LIBDIR=C:/dev/mysql-dev/lib/lib/libmysql.lib"" print?

                            mingw32-make is in your PATH when you opened the correct Qt command prompt.

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

                            silvio_2020S 1 Reply Last reply
                            1
                            • Christian EhrlicherC Christian Ehrlicher

                              These are two commands ...
                              what did
                              "qmake -- MYSQL_INCDIR=C:\dev\mysql-dev\include "MYSQL_LIBDIR=C:/dev/mysql-dev/lib/lib/libmysql.lib"" print?

                              mingw32-make is in your PATH when you opened the correct Qt command prompt.

                              silvio_2020S Offline
                              silvio_2020S Offline
                              silvio_2020
                              wrote on last edited by
                              #14

                              @Christian-Ehrlicher said in building mysql plugin for qt (c++):

                              These are two commands ...
                              what did
                              "qmake -- MYSQL_INCDIR=C:\dev\mysql-dev\include "MYSQL_LIBDIR=C:/dev/mysql-dev/lib/lib/libmysql.lib"" print?

                              mingw32-make is in your PATH when you opened the correct Qt command prompt.

                              @Christian-Ehrlicher

                              i opened CMD in this directory after updating envirennement variable
                              C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers\mysql

                              1 Reply Last reply
                              0
                              • Christian EhrlicherC Offline
                                Christian EhrlicherC Offline
                                Christian Ehrlicher
                                Lifetime Qt Champion
                                wrote on last edited by Christian Ehrlicher
                                #15

                                @silvio_2020 said in building mysql plugin for qt (c++):

                                i opened CMD in this directory after updating envirennement variable

                                This is wrong, you have to open your Qt command line where your compiler is correctly set up.

                                C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers\mysql

                                And this is also the wrong directory according to the documentation.

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

                                silvio_2020S 1 Reply Last reply
                                1
                                • Christian EhrlicherC Christian Ehrlicher

                                  @silvio_2020 said in building mysql plugin for qt (c++):

                                  i opened CMD in this directory after updating envirennement variable

                                  This is wrong, you have to open your Qt command line where your compiler is correctly set up.

                                  C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers\mysql

                                  And this is also the wrong directory according to the documentation.

                                  silvio_2020S Offline
                                  silvio_2020S Offline
                                  silvio_2020
                                  wrote on last edited by
                                  #16

                                  @Christian-Ehrlicher said in building mysql plugin for qt (c++):

                                  @silvio_2020 said in building mysql plugin for qt (c++):

                                  i opened CMD in this directory after updating envirennement variable

                                  This is wrong, you have to open your Qt command line where your compiler is correctly set up.

                                  C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers\mysql

                                  And this is also the wrong directory according to the documentation.

                                  i tried with the right path (sqldrivers)
                                  and you can see what is the result
                                  qmake -- MYSQL_INCDIR=C:\dev\mysql-dev\include "MYSQL_LIBDIR=C:/dev/mysql-dev/lib/opt" mingw32-make sub-mysql
                                  "error: invalid command line parameter 'mingw32-make'"

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #17

                                    As @Christian-Ehrlicher already pointed out, your are writing two different commands as one hence the error you are getting.

                                    Keep them properly separated as in the documentation and @Christian-Ehrlicher's post.

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

                                    silvio_2020S 1 Reply Last reply
                                    0
                                    • Christian EhrlicherC Offline
                                      Christian EhrlicherC Offline
                                      Christian Ehrlicher
                                      Lifetime Qt Champion
                                      wrote on last edited by Christian Ehrlicher
                                      #18

                                      @silvio_2020 said in building mysql plugin for qt (c++):

                                      "error: invalid command line parameter 'mingw32-make'"

                                      Again: This is not in the docs! These are two commands:

                                      "qmake -- MYSQL_INCDIR=C:\dev\mysql-dev\include "MYSQL_LIBDIR=C:/dev/mysql-dev/lib/opt""
                                      and
                                      "mingw32-make sub-mysql"

                                      Is it so hard to follow the instructions?

                                      /edit: here is a slightly updated document: https://doc-snapshots.qt.io/qt5-5.14/sql-driver.html#how-to-build-the-qmysql-plugin-on-windows

                                      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
                                      0
                                      • Christian EhrlicherC Christian Ehrlicher

                                        @SGaist said in building mysql plugin for qt (c++):

                                        What exact error are you getting in the logs ?

                                        And what was your command line? Did you remove config.cache in the directory before?

                                        silvio_2020S Offline
                                        silvio_2020S Offline
                                        silvio_2020
                                        wrote on last edited by
                                        #19
                                        This post is deleted!
                                        1 Reply Last reply
                                        0
                                        • Christian EhrlicherC Christian Ehrlicher

                                          @SGaist said in building mysql plugin for qt (c++):

                                          What exact error are you getting in the logs ?

                                          And what was your command line? Did you remove config.cache in the directory before?

                                          silvio_2020S Offline
                                          silvio_2020S Offline
                                          silvio_2020
                                          wrote on last edited by
                                          #20

                                          @Christian-Ehrlicher said in building mysql plugin for qt (c++):

                                          @SGaist said in building mysql plugin for qt (c++):

                                          What exact error are you getting in the logs ?

                                          And what was your command line? Did you remove config.cache in the directory before?

                                          what means removing config.cach ?
                                          the same issue , when i launch the command as described it shows me
                                          mysql..... no
                                          what scenaro i am missing ?

                                          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