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. Problem building qtbase from source
Forum Updated to NodeBB v4.3 + New Features

Problem building qtbase from source

Scheduled Pinned Locked Moved Solved Installation and Deployment
18 Posts 3 Posters 4.2k Views 1 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 15 May 2020, 18:58 last edited by
    #6

    To build qtbase, you have to call configure. qmake is built as part of the bootstrap process.

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

    T 1 Reply Last reply 17 May 2020, 21:14
    1
    • S SGaist
      15 May 2020, 18:58

      To build qtbase, you have to call configure. qmake is built as part of the bootstrap process.

      T Offline
      T Offline
      Tom asso
      wrote on 17 May 2020, 21:14 last edited by Tom asso
      #7

      @SGaist Thanks again SGaist - my apologies for all the questions, but is the procedure for building sources that come from the downloaded .run file (e.g qt-opensource-linux-x64-5.14.2.run) documented somewhere? As you suggest, I now run ./configure (instead of qmake directly), but still have problems.

      When I execute qt-opensource-linux-x64-5.14.2.run on my ubuntu 18.04 system, it places files including sources and shared libraries in $HOME/Qt5.14.2.. I can link my application with the shared libraries in $HOME/Qt5.14.2/5.14.2/gcc_64/

      Now I want to modify some source files in Qt5.14.2 qtbase

      % cd 5.14.2/Src/qtbase
      % ./configure   # builds (and runs?) qmake, generates Makefile
      

      Now if I run ‘make’ it successfully runs to completion. If I modify a qtbase source file and run ‘make’ again, it successfully builds. However ‘make’ rebuilds the libraries in 5.14.2/Src/qtbase/lib - but my app is linking with 5.14.2/gcc_64/lib. How do I “install” the rebuilt libraries into that directory? Is it ‘make install’? I tried “make install”, but it fails:

      % make install
       
      cd src/ && ( test -e Makefile || /home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/bin/qmake -o Makefile /home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src/src.pro ) && make -f Makefile install
      make[1]: Entering directory '/home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src'
      cd tools/bootstrap/ && ( test -e Makefile || /home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/bin/qmake -o Makefile /home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src/tools/bootstrap/bootstrap.pro ) && make -f Makefile install
      make[2]: Entering directory '/home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src/tools/bootstrap'
      /home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/bin/qmake -install qinstall ../../../lib/libQt5Bootstrap.a /usr/local/Qt-5.14.2/lib/libQt5Bootstrap.a
      Error copying ../../../lib/libQt5Bootstrap.a to /usr/local/Qt-5.14.2/lib/libQt5Bootstrap.a: Destination file exists
      Makefile:14154: recipe for target 'install_target' failed
      make[2]: *** [install_target] Error 3
      make[2]: Leaving directory '/home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src/tools/bootstrap'
      Makefile:82: recipe for target 'sub-bootstrap-install_subtargets' failed
      make[1]: *** [sub-bootstrap-install_subtargets] Error 2
      make[1]: Leaving directory '/home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src'
      Makefile:62: recipe for target 'sub-src-install_subtargets' failed
      make: *** [sub-src-install_subtargets] Error 2
      

      If I just manually copy all libraries from 5.14.2/Src/qtbase/lib to 5.14.2/gcc_64/lib, then link my application with those, it gives this error:

      /home/oreilly/Qt5.14.2/5.14.2/gcc_64/lib/libQt5Qml.so: undefined reference to `operator delete[](void*, unsigned long)@Qt_5'
      /home/oreilly/Qt5.14.2/5.14.2/gcc_64/lib/libQt5Quick.so: undefined reference to `operator delete(void*, unsigned long)@Qt_5'
      collect2: error: ld returned 1 exit status
      Makefile:373: recipe for target 'mbgrdviz-2' failed
      

      So I am still missing something...

      J 1 Reply Last reply 18 May 2020, 05:44
      0
      • T Tom asso
        17 May 2020, 21:14

        @SGaist Thanks again SGaist - my apologies for all the questions, but is the procedure for building sources that come from the downloaded .run file (e.g qt-opensource-linux-x64-5.14.2.run) documented somewhere? As you suggest, I now run ./configure (instead of qmake directly), but still have problems.

        When I execute qt-opensource-linux-x64-5.14.2.run on my ubuntu 18.04 system, it places files including sources and shared libraries in $HOME/Qt5.14.2.. I can link my application with the shared libraries in $HOME/Qt5.14.2/5.14.2/gcc_64/

        Now I want to modify some source files in Qt5.14.2 qtbase

        % cd 5.14.2/Src/qtbase
        % ./configure   # builds (and runs?) qmake, generates Makefile
        

        Now if I run ‘make’ it successfully runs to completion. If I modify a qtbase source file and run ‘make’ again, it successfully builds. However ‘make’ rebuilds the libraries in 5.14.2/Src/qtbase/lib - but my app is linking with 5.14.2/gcc_64/lib. How do I “install” the rebuilt libraries into that directory? Is it ‘make install’? I tried “make install”, but it fails:

        % make install
         
        cd src/ && ( test -e Makefile || /home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/bin/qmake -o Makefile /home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src/src.pro ) && make -f Makefile install
        make[1]: Entering directory '/home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src'
        cd tools/bootstrap/ && ( test -e Makefile || /home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/bin/qmake -o Makefile /home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src/tools/bootstrap/bootstrap.pro ) && make -f Makefile install
        make[2]: Entering directory '/home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src/tools/bootstrap'
        /home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/bin/qmake -install qinstall ../../../lib/libQt5Bootstrap.a /usr/local/Qt-5.14.2/lib/libQt5Bootstrap.a
        Error copying ../../../lib/libQt5Bootstrap.a to /usr/local/Qt-5.14.2/lib/libQt5Bootstrap.a: Destination file exists
        Makefile:14154: recipe for target 'install_target' failed
        make[2]: *** [install_target] Error 3
        make[2]: Leaving directory '/home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src/tools/bootstrap'
        Makefile:82: recipe for target 'sub-bootstrap-install_subtargets' failed
        make[1]: *** [sub-bootstrap-install_subtargets] Error 2
        make[1]: Leaving directory '/home/oreilly/Qt5.14.2/5.14.2/Src/qtbase/src'
        Makefile:62: recipe for target 'sub-src-install_subtargets' failed
        make: *** [sub-src-install_subtargets] Error 2
        

        If I just manually copy all libraries from 5.14.2/Src/qtbase/lib to 5.14.2/gcc_64/lib, then link my application with those, it gives this error:

        /home/oreilly/Qt5.14.2/5.14.2/gcc_64/lib/libQt5Qml.so: undefined reference to `operator delete[](void*, unsigned long)@Qt_5'
        /home/oreilly/Qt5.14.2/5.14.2/gcc_64/lib/libQt5Quick.so: undefined reference to `operator delete(void*, unsigned long)@Qt_5'
        collect2: error: ld returned 1 exit status
        Makefile:373: recipe for target 'mbgrdviz-2' failed
        

        So I am still missing something...

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 18 May 2020, 05:44 last edited by
        #8

        @Tom-asso Since you're you're installing into /usr/local you should call make install with sudo.

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

        T 1 Reply Last reply 18 May 2020, 15:02
        2
        • J jsulm
          18 May 2020, 05:44

          @Tom-asso Since you're you're installing into /usr/local you should call make install with sudo.

          T Offline
          T Offline
          Tom asso
          wrote on 18 May 2020, 15:02 last edited by
          #9

          @jsulm - ah, you are right of course!

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 18 May 2020, 18:16 last edited by SGaist
            #10

            Note that if you want to hack on Qt itself, you can use the developer-build and it will do an in place build. However it should not be used to build software releases as it toggles some flags for development.

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

            T 1 Reply Last reply 18 May 2020, 20:42
            1
            • S SGaist
              18 May 2020, 18:16

              Note that if you want to hack on Qt itself, you can use the developer-build and it will do an in place build. However it should not be used to build software releases as it toggles some flags for development.

              T Offline
              T Offline
              Tom asso
              wrote on 18 May 2020, 20:42 last edited by
              #11

              @SGaist - could you please explain? What is the "developer build", and what is the "development.3" flag?
              I would like to modify qtdatavisualization3d for my app, then freely distribute to users on a non-commercial basis - which source file should I be using in that case?
              Thanks!

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 18 May 2020, 21:22 last edited by
                #12

                The 3 was a typo.
                As I wrote, it will trigger an in-place build, meaning that you won't have to call make install each time you want to test your modifications.

                In that case, you should only build that module rather than the whole of Qt.

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

                T 1 Reply Last reply 18 May 2020, 23:12
                1
                • S SGaist
                  18 May 2020, 21:22

                  The 3 was a typo.
                  As I wrote, it will trigger an in-place build, meaning that you won't have to call make install each time you want to test your modifications.

                  In that case, you should only build that module rather than the whole of Qt.

                  T Offline
                  T Offline
                  Tom asso
                  wrote on 18 May 2020, 23:12 last edited by
                  #13

                  @SGaist - thanks. Earlier you mentioned a "Ce" option to specify a particular sub-folder to build. Can you please refer me to a page describing how to use that?
                  Thanks!

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    Tom asso
                    wrote on 19 May 2020, 07:06 last edited by
                    #14

                    @SGaist - after building in-place with 'make', the libraries are scattered among many different subdirectories. What is the best way to link against those, when there are in so many different places?
                    Thanks!

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 19 May 2020, 07:22 last edited by
                      #15

                      Did you do a build from scratch after adding that option to your configure line ?

                      With a developer build you should have all binaries in qtbase/bin and the libraries in qtbase/lib.

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

                      T 1 Reply Last reply 19 May 2020, 22:46
                      1
                      • S SGaist
                        19 May 2020, 07:22

                        Did you do a build from scratch after adding that option to your configure line ?

                        With a developer build you should have all binaries in qtbase/bin and the libraries in qtbase/lib.

                        T Offline
                        T Offline
                        Tom asso
                        wrote on 19 May 2020, 22:46 last edited by
                        #16

                        @SGaist - yes I see them there, thanks.
                        Earlier you mentioned a "Ce" option to specify a particular sub-folder to build. Can you please refer me to a page describing how to use that?
                        Thanks!

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          Tom asso
                          wrote on 20 May 2020, 15:12 last edited by
                          #17

                          I do not see a qtcreator executable after building qt-everywhere-src-5.14.2. Is that expected?
                          I built with these configure options: -qt-xcb -recheck-all -debug -developer-build

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 20 May 2020, 15:23 last edited by
                            #18

                            Yes it is to be expected, Qt Creator is a independent project.

                            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
                            • S sefo referenced this topic on 1 Jul 2024, 13:10

                            15/18

                            19 May 2020, 07:22

                            • Login

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