Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?
Forum Updated to NodeBB v4.3 + New Features

Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
28 Posts 4 Posters 5.8k 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.
  • E enne9
    21 Feb 2020, 07:43

    @jsulm there is no libmysql-dev package, I instead installed libmysqlclient-dev.
    The error I am getting is still

    ERROR: Feature 'sql-mysql' was enabled, but the pre-condition 'libs.mysql' failed.
    

    Sorry, I wasn't pushing and I am sorry if it seemed so.

    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 21 Feb 2020, 07:47 last edited by
    #12

    @enne9 said in Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?:

    libmysqlclient-dev

    This one should be the correct one.
    Did you check config.log to see whether there are more specific errors regarding MySQL plug-in?

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

    1 Reply Last reply
    0
    • J jsulm
      21 Feb 2020, 05:24

      @enne9 As far as I know you need to build MySQL plug-in by yourself (because of legal reasons).
      Install the libmysql-dev package and check https://doc.qt.io/qt-5/sql-driver.html for instructions how to build.

      J Offline
      J Offline
      JonB
      wrote on 21 Feb 2020, 08:04 last edited by
      #13

      @jsulm said in Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?:

      @enne9 As far as I know you need to build MySQL plug-in by yourself (because of legal reasons).
      Install the libmysql-dev package and check https://doc.qt.io/qt-5/sql-driver.html for instructions how to build.

      Just for clarification: I have used Qt & MySQL up to Ubuntu 19.04. I have only ever had to use apt-get for packages, I have never had to compile/build/configure Qt or anything MySQL. Did the change requiring needing to build MySQL plug-in come in at 19.10?

      J 1 Reply Last reply 21 Feb 2020, 08:18
      0
      • J JonB
        21 Feb 2020, 08:04

        @jsulm said in Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?:

        @enne9 As far as I know you need to build MySQL plug-in by yourself (because of legal reasons).
        Install the libmysql-dev package and check https://doc.qt.io/qt-5/sql-driver.html for instructions how to build.

        Just for clarification: I have used Qt & MySQL up to Ubuntu 19.04. I have only ever had to use apt-get for packages, I have never had to compile/build/configure Qt or anything MySQL. Did the change requiring needing to build MySQL plug-in come in at 19.10?

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 21 Feb 2020, 08:18 last edited by
        #14

        @JonB Did you use Qt provided by the distribution?

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

        J 1 Reply Last reply 21 Feb 2020, 08:23
        0
        • S SGaist
          21 Feb 2020, 07:46

          Did you re-run configure from a clean state ? If not, as suggested in the summary, you should clean the sources if you called configure it.

          Better yet, do an out of source build so that you can just nuke the build folder to restart fresh.

          If it is still failing, then check the test logs to see exactly why the detection failed.

          E Offline
          E Offline
          enne9
          wrote on 21 Feb 2020, 08:20 last edited by
          #15

          @SGaist Thanks, I uninstalled everything using the maintenance tool and then reinstalled again using, as usual, the offline installer.
          I run ./configure -sql-mysql as first command and finally there was "yes" near "MySql" and the process ended well.

          In the previous attempt I had already run ./configure before ./configure -sql-mysql without cleaning, was that the problem in your opinion?

          S 1 Reply Last reply 21 Feb 2020, 08:24
          0
          • J jsulm
            21 Feb 2020, 08:18

            @JonB Did you use Qt provided by the distribution?

            J Offline
            J Offline
            JonB
            wrote on 21 Feb 2020, 08:23 last edited by JonB
            #16

            @jsulm said in Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?:

            @JonB Did you use Qt provided by the distribution?

            Yes, absolutely, the Qt 5.12.2 which came with Ubuntu 19.04 was adequate for me. I didn't see anything in OP's question which said he had built Qt for himself. Given that, I have never had to build/configure Qt, any the libraries to hook Qt to MySQL also come from apt-get. Hence why I was asking whether that will have changed at 19.10? Because if so I shall not be moving off 19.04 till I have to, hence my question....

            J 1 Reply Last reply 21 Feb 2020, 08:26
            0
            • E enne9
              21 Feb 2020, 08:20

              @SGaist Thanks, I uninstalled everything using the maintenance tool and then reinstalled again using, as usual, the offline installer.
              I run ./configure -sql-mysql as first command and finally there was "yes" near "MySql" and the process ended well.

              In the previous attempt I had already run ./configure before ./configure -sql-mysql without cleaning, was that the problem in your opinion?

              S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 21 Feb 2020, 08:24 last edited by
              #17

              @enne9 said in Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?:

              In the previous attempt I had already run ./configure before ./configure -sql-mysql without cleaning, was that the problem in your opinion?

              Yes, as suggested in the summary message, if you changed something like adding a new dependency library and re-run configure, you have to clean before calling configure again.

              But as I already wrote, out of source builds are way simpler to handle that kind use case. You keep the sources clean and can nuke easily the faulty build/configure to start anew.

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

              1 Reply Last reply
              2
              • J JonB
                21 Feb 2020, 08:23

                @jsulm said in Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?:

                @JonB Did you use Qt provided by the distribution?

                Yes, absolutely, the Qt 5.12.2 which came with Ubuntu 19.04 was adequate for me. I didn't see anything in OP's question which said he had built Qt for himself. Given that, I have never had to build/configure Qt, any the libraries to hook Qt to MySQL also come from apt-get. Hence why I was asking whether that will have changed at 19.10? Because if so I shall not be moving off 19.04 till I have to, hence my question....

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 21 Feb 2020, 08:26 last edited by
                #18

                @JonB said in Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?:

                he had built Qt for himself

                It applies to Qt installed via installer as well

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

                J 1 Reply Last reply 21 Feb 2020, 08:29
                0
                • J jsulm
                  21 Feb 2020, 08:26

                  @JonB said in Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?:

                  he had built Qt for himself

                  It applies to Qt installed via installer as well

                  J Offline
                  J Offline
                  JonB
                  wrote on 21 Feb 2020, 08:29 last edited by JonB
                  #19

                  @jsulm

                  It applies to Qt installed via installer as well

                  Hmm, I've never done that. Only ever apt-get. I hope I'm not hijacking (tell me if I am), but let's put it this way: if I move to a newer Ubuntu, and I want the Qt and the libqtmysql stuff as supplied with distro via apt-get, can I still do that (absolutely no compiling/building/configuring of either), or at 19.10+ has something been removed which means it won't work any longer?

                  J 1 Reply Last reply 21 Feb 2020, 08:30
                  0
                  • J JonB
                    21 Feb 2020, 08:29

                    @jsulm

                    It applies to Qt installed via installer as well

                    Hmm, I've never done that. Only ever apt-get. I hope I'm not hijacking (tell me if I am), but let's put it this way: if I move to a newer Ubuntu, and I want the Qt and the libqtmysql stuff as supplied with distro via apt-get, can I still do that (absolutely no compiling/building/configuring of either), or at 19.10+ has something been removed which means it won't work any longer?

                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 21 Feb 2020, 08:30 last edited by
                    #20

                    @JonB said in Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?:

                    can I still do that

                    Yes, the prebuild Qt provided by Ubuntu should have everything you need (but I did not yet use any of 19.x Ubuntu).

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

                    J 1 Reply Last reply 21 Feb 2020, 08:32
                    2
                    • J jsulm
                      21 Feb 2020, 08:30

                      @JonB said in Simplest way to install Qt in Ubuntu (19.10) with MySQL driver?:

                      can I still do that

                      Yes, the prebuild Qt provided by Ubuntu should have everything you need (but I did not yet use any of 19.x Ubuntu).

                      J Offline
                      J Offline
                      JonB
                      wrote on 21 Feb 2020, 08:32 last edited by
                      #21

                      @jsulm
                      That's great. Then at least the OP knows that if he is happy with the Qt version in the 19.10 distro has has the option of doing it all with no compiling etc. Having said that, his latest may imply he is now progressing OK with what he has, which is equally fine.

                      1 Reply Last reply
                      0
                      • E Offline
                        E Offline
                        enne9
                        wrote on 21 Feb 2020, 13:09 last edited by enne9
                        #22

                        The make compilation completed successfully but make install terminates with the error

                        g++: error: /home/enrico/Qt5.14.1/5.14.1/Src/qtvirtualkeyboard/lib/libqtopenwnn.a: No such file or directory
                        

                        Any idea?

                        1 Reply Last reply
                        0
                        • E Offline
                          E Offline
                          enne9
                          wrote on 21 Feb 2020, 13:20 last edited by enne9
                          #23

                          I have just noticed that I have used make instead of qmake. Is that the problem?

                          Should I repeat the whole process using qmake and, if this is the case, should I clean run a make clean before?
                          Thanks

                          An update: now the error is

                          Error copying ../../../lib/libQt5Bootstrap.a to /usr/local/Qt-5.14.1/lib/libQt5Bootstrap.a: Destination file exists
                          
                          
                          J 1 Reply Last reply 21 Feb 2020, 13:24
                          0
                          • E enne9
                            21 Feb 2020, 13:20

                            I have just noticed that I have used make instead of qmake. Is that the problem?

                            Should I repeat the whole process using qmake and, if this is the case, should I clean run a make clean before?
                            Thanks

                            An update: now the error is

                            Error copying ../../../lib/libQt5Bootstrap.a to /usr/local/Qt-5.14.1/lib/libQt5Bootstrap.a: Destination file exists
                            
                            
                            J Offline
                            J Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 21 Feb 2020, 13:24 last edited by
                            #24

                            @enne9 Did you run qmake before make?
                            The sequence is:

                            • qmake
                            • make
                            • make install

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

                            1 Reply Last reply
                            0
                            • E Offline
                              E Offline
                              enne9
                              wrote on 21 Feb 2020, 13:32 last edited by
                              #25

                              I used

                              ./configure -sql-mysql
                              make
                              make install
                              

                              How can I proceed now? Do I need to clean (using which commands?) and do the operations in the order you listed?

                              J 1 Reply Last reply 21 Feb 2020, 13:36
                              0
                              • E enne9
                                21 Feb 2020, 13:32

                                I used

                                ./configure -sql-mysql
                                make
                                make install
                                

                                How can I proceed now? Do I need to clean (using which commands?) and do the operations in the order you listed?

                                J Offline
                                J Offline
                                jsulm
                                Lifetime Qt Champion
                                wrote on 21 Feb 2020, 13:36 last edited by
                                #26

                                @enne9 As @SGaist already suggested do out of source builds, this way you will have less troubles.
                                Use "make clean" to clean up.

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

                                1 Reply Last reply
                                0
                                • E Offline
                                  E Offline
                                  enne9
                                  wrote on 21 Feb 2020, 13:46 last edited by
                                  #27

                                  Isn't qmake included in ./configure -sql-mysql? I just run it and the output is the same.

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 21 Feb 2020, 18:36 last edited by
                                    #28

                                    It's the first thing that gets built however, you are currently making things more complicated than necessary. You should just build the plugin using your already installed Qt rather than the full thing.

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

                                    1 Reply Last reply
                                    1

                                    21/28

                                    21 Feb 2020, 08:32

                                    • Login

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