Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Need help statically building qt for Ubuntu
QtWS25 Last Chance

Need help statically building qt for Ubuntu

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
17 Posts 10 Posters 4.9k 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
    awstokes
    wrote on 10 Nov 2022, 17:59 last edited by
    #1

    Hello I have spent a few hours trying to figure this out but now I'm stuck. Here is what I tried so far.
    First. I downloaded the source from here https://download.qt.io/official_releases/qt/6.3/6.3.2/single/
    I unzipped the tar.gz file and tried running .

    ./configure -v -static -release -ltcg -optimize-size -no-pch -prefix ~/Qt5static/5.14.2/ -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -qt-xcb -qt-harfbuzz -make libs -nomake tools -nomake examples -nomake tests -opensource -confirm-license -skip qtwebengine -dbus-linked -no-rpath -openssl-linked -opengl desktop -sysconfdir "/etc/xdg" -no-qml-debug -feature-freetype -fontconfig -feature-relocatable -strip

    I received an error informing me that I'm using an older cmake version I updated cmake to the latest using the following steps
    chmod +x cmake-3.25.0-rc4/
    bash cmake-3.25.0-rc4/
    cd cmake-3.25.0-rc4/
    make
    make install
    cmake --version

    When I try to run the ./configure command again, i'm getting the following.
    CMake Warning (dev) at qtbase/cmake/QtBuildInformation.cmake:257 (set):
    Cannot set "__qt_configure_reports": current scope has no parent.
    Call Stack (most recent call first):
    qtsensors/src/sensors/configure.cmake:45 (qt_configure_add_report)
    qtbase/cmake/QtProcessConfigureArgs.cmake:242 (include)
    This warning is for project developers. Use -Wno-dev to suppress it.

    CMake Error at qtwebengine/configure.cmake:63 (check_for_ulimit):
    Unknown CMake command "check_for_ulimit".
    Call Stack (most recent call first):
    qtbase/cmake/QtProcessConfigureArgs.cmake:242 (include)

    Can someone point me in the right direction and tell me what step am I missing or what I'm doing wrong here?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Nov 2022, 19:22 last edited by
      #2

      Hi and welcome to devnet,

      QtWebEngine cannot be built statically because the chromium project that powers it does not allow that.

      That said, you should only build the modules you need rather than the full 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

      J 1 Reply Last reply 6 Jun 2023, 12:18
      0
      • A Offline
        A Offline
        awstokes
        wrote on 10 Nov 2022, 19:43 last edited by
        #3

        @SGaist said in Need help statically building qt for Ubuntu:

        QtWebEngine

        Thanks this might sound dumb but I have -skip qtwebengine above . How do I remove the modules I do not need?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 10 Nov 2022, 19:54 last edited by
          #4

          I missed it. The most simple is to remove the folder from the source tree. Either move it out or delete it.

          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
          0
          • A Offline
            A Offline
            awstokes
            wrote on 18 Nov 2022, 14:43 last edited by
            #5

            Thanks for your help. I ended up reverting to 5.17 and it looks like the QT components are statically linked but I'm now having Multiple issues with other components (i.e libcurl)

            The first issue is:
            When I run the LDD command I see a bunch of dependencies
            ldd /usr/local/bin/LinuxTL-1.0.20.0
            linux-vdso.so.1 (0x00007fffa6574000)
            libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007f5178761000)
            libxcb-glx.so.0 => not found
            libxcb-icccm.so.4 => not found
            libxcb-image.so.0 => not found
            libxcb-shm.so.0 => not found
            libxcb-keysyms.so.1 => not found
            libxcb-randr.so.0 => not found
            libxcb-render-util.so.0 => not found
            libxcb-render.so.0 => not found
            libxcb-shape.so.0 => not found
            libxcb-sync.so.1 => not found
            libxcb-xfixes.so.0 => not found
            libxcb-xinerama.so.0 => not found
            libxcb-xkb.so.1 => not found
            libxcb-xinput.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-xinput.so.0 (0x00007f5178739000)
            libSM.so.6 => not found
            libICE.so.6 => not found
            libxkbcommon-x11.so.0 => not found
            libdrm.so.2 => not found
            libX11-xcb.so.1 => not found
            libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f517870c000)
            libwayland-egl.so.1 => not found
            libEGL.so.1 => not found
            libXcomposite.so.1 => not found
            libX11.so.6 => not found
            libfontconfig.so.1 => not found
            libfreetype.so.6 => not found
            libdbus-1.so.3 => not found
            libwayland-cursor.so.0 => not found
            libwayland-client.so.0 => not found
            libxkbcommon.so.0 => not found
            libpng16.so.16 => not found
            libharfbuzz.so.0 => not found
            libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f51786eb000)
            libicui18n.so.66 => not found
            libicuuc.so.66 => not found
            libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f51786e3000)
            libpcre2-16.so.0 => /usr/lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007f5178658000)
            libglib-2.0.so.0 => not found
            libGL.so.1 => not found
            libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5178634000)
            libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5178467000)
            libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5178323000)
            libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5178309000)
            libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5178134000)
            /lib64/ld-linux-x86-64.so.2 (0x00007f5179b5c000)
            libnghttp2.so.14 => /usr/lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007f5178107000)
            libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007f51780e4000)
            librtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007f51780c5000)
            libssh2.so.1 => /usr/lib/x86_64-linux-gnu/libssh2.so.1 (0x00007f5178090000)
            libpsl.so.5 => /usr/lib/x86_64-linux-gnu/libpsl.so.5 (0x00007f517807c000)
            libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007f5177fe9000)
            libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f5177cf5000)
            libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f5177ca0000)
            libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f5177c4a000)
            liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f5177c39000)
            libbrotlidec.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007f5177c2b000)
            libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f5177c26000)
            libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f5177a20000)
            libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007f517789c000)
            libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f517769c000)
            libhogweed.so.6 => /usr/lib/x86_64-linux-gnu/libhogweed.so.6 (0x00007f5177653000)
            libnettle.so.8 => /usr/lib/x86_64-linux-gnu/libnettle.so.8 (0x00007f517760b000)
            libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f517758a000)
            libgcrypt.so.20 => /usr/lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f5177468000)
            libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f517738e000)
            libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f517735e000)
            libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f5177358000)
            libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f5177349000)
            libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f517732f000)
            libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f5177310000)
            libbrotlicommon.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007f51772ed000)
            libbsd.so.0 => /usr/lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f51772d6000)
            libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f51771a2000)
            libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f517718c000)
            libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f5177164000)
            libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f517715d000)
            libmd.so.0 => /usr/lib/x86_64-linux-gnu/libmd.so.0 (0x00007f5177150000)
            libffi.so.7 => /usr/lib/x86_64-linux-gnu/libffi.so.7 (0x00007f5177144000)

            Sorry for my ignorance but what do I need to do for the non qt components. In my project file I thought adding this would be enough for my project.

            unix:!android: LIBS += -lcurl

            But on my teammate machine he needed to install the following on his distribution to work
            sudo apt-get -y install libpcre2-16-0
            sudo apt-get -y install libxcb-xinput0
            sudo apt-get -y install libcurl4-openssl-dev
            sudo apt-get -y install libxkbcommon-dev
            sudo apt-get -y install libx11-xcb-dev
            sudo apt-get -y install libxcb*-dev
            sudo apt-get -y install libfontconfig1-dev
            sudo apt-get -y install libxkbcommon-x11-dev
            sudo apt-get -y install libgtk-3-dev
            sudo apt-get install --reinstall libxcb-xinerama0

            The second issue may not have anything to do with static linking but whether how he is trying to launch our application. I'll either post a new topic on that issue.

            jsulmJ 1 Reply Last reply 18 Nov 2022, 14:52
            0
            • A awstokes
              18 Nov 2022, 14:43

              Thanks for your help. I ended up reverting to 5.17 and it looks like the QT components are statically linked but I'm now having Multiple issues with other components (i.e libcurl)

              The first issue is:
              When I run the LDD command I see a bunch of dependencies
              ldd /usr/local/bin/LinuxTL-1.0.20.0
              linux-vdso.so.1 (0x00007fffa6574000)
              libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007f5178761000)
              libxcb-glx.so.0 => not found
              libxcb-icccm.so.4 => not found
              libxcb-image.so.0 => not found
              libxcb-shm.so.0 => not found
              libxcb-keysyms.so.1 => not found
              libxcb-randr.so.0 => not found
              libxcb-render-util.so.0 => not found
              libxcb-render.so.0 => not found
              libxcb-shape.so.0 => not found
              libxcb-sync.so.1 => not found
              libxcb-xfixes.so.0 => not found
              libxcb-xinerama.so.0 => not found
              libxcb-xkb.so.1 => not found
              libxcb-xinput.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-xinput.so.0 (0x00007f5178739000)
              libSM.so.6 => not found
              libICE.so.6 => not found
              libxkbcommon-x11.so.0 => not found
              libdrm.so.2 => not found
              libX11-xcb.so.1 => not found
              libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f517870c000)
              libwayland-egl.so.1 => not found
              libEGL.so.1 => not found
              libXcomposite.so.1 => not found
              libX11.so.6 => not found
              libfontconfig.so.1 => not found
              libfreetype.so.6 => not found
              libdbus-1.so.3 => not found
              libwayland-cursor.so.0 => not found
              libwayland-client.so.0 => not found
              libxkbcommon.so.0 => not found
              libpng16.so.16 => not found
              libharfbuzz.so.0 => not found
              libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f51786eb000)
              libicui18n.so.66 => not found
              libicuuc.so.66 => not found
              libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f51786e3000)
              libpcre2-16.so.0 => /usr/lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007f5178658000)
              libglib-2.0.so.0 => not found
              libGL.so.1 => not found
              libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5178634000)
              libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5178467000)
              libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5178323000)
              libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5178309000)
              libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5178134000)
              /lib64/ld-linux-x86-64.so.2 (0x00007f5179b5c000)
              libnghttp2.so.14 => /usr/lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007f5178107000)
              libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007f51780e4000)
              librtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007f51780c5000)
              libssh2.so.1 => /usr/lib/x86_64-linux-gnu/libssh2.so.1 (0x00007f5178090000)
              libpsl.so.5 => /usr/lib/x86_64-linux-gnu/libpsl.so.5 (0x00007f517807c000)
              libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007f5177fe9000)
              libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f5177cf5000)
              libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f5177ca0000)
              libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f5177c4a000)
              liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f5177c39000)
              libbrotlidec.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007f5177c2b000)
              libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f5177c26000)
              libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f5177a20000)
              libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007f517789c000)
              libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f517769c000)
              libhogweed.so.6 => /usr/lib/x86_64-linux-gnu/libhogweed.so.6 (0x00007f5177653000)
              libnettle.so.8 => /usr/lib/x86_64-linux-gnu/libnettle.so.8 (0x00007f517760b000)
              libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f517758a000)
              libgcrypt.so.20 => /usr/lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f5177468000)
              libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f517738e000)
              libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f517735e000)
              libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f5177358000)
              libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f5177349000)
              libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f517732f000)
              libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f5177310000)
              libbrotlicommon.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007f51772ed000)
              libbsd.so.0 => /usr/lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f51772d6000)
              libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f51771a2000)
              libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f517718c000)
              libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f5177164000)
              libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f517715d000)
              libmd.so.0 => /usr/lib/x86_64-linux-gnu/libmd.so.0 (0x00007f5177150000)
              libffi.so.7 => /usr/lib/x86_64-linux-gnu/libffi.so.7 (0x00007f5177144000)

              Sorry for my ignorance but what do I need to do for the non qt components. In my project file I thought adding this would be enough for my project.

              unix:!android: LIBS += -lcurl

              But on my teammate machine he needed to install the following on his distribution to work
              sudo apt-get -y install libpcre2-16-0
              sudo apt-get -y install libxcb-xinput0
              sudo apt-get -y install libcurl4-openssl-dev
              sudo apt-get -y install libxkbcommon-dev
              sudo apt-get -y install libx11-xcb-dev
              sudo apt-get -y install libxcb*-dev
              sudo apt-get -y install libfontconfig1-dev
              sudo apt-get -y install libxkbcommon-x11-dev
              sudo apt-get -y install libgtk-3-dev
              sudo apt-get install --reinstall libxcb-xinerama0

              The second issue may not have anything to do with static linking but whether how he is trying to launch our application. I'll either post a new topic on that issue.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on 18 Nov 2022, 14:52 last edited by
              #6

              @awstokes said in Need help statically building qt for Ubuntu:

              but I'm now having Multiple issues with other components

              Do you mean that those components are dynamically linked? If so and you want to link them statically you need all those components also built as static libs.

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

              1 Reply Last reply
              2
              • H Offline
                H Offline
                hamer
                wrote on 30 Nov 2022, 09:39 last edited by
                #7

                If you want to use Qt 6 then you have to manually add the following to qtwebengine/configure.cmake:

                if(QT_CONFIGURE_RUNNING)
                
                    function(check_for_ulimit)
                    endfunction()
                

                At least, this fixed the problem for me.

                M A C 3 Replies Last reply 1 Dec 2022, 08:44
                3
                • H hamer
                  30 Nov 2022, 09:39

                  If you want to use Qt 6 then you have to manually add the following to qtwebengine/configure.cmake:

                  if(QT_CONFIGURE_RUNNING)
                  
                      function(check_for_ulimit)
                      endfunction()
                  

                  At least, this fixed the problem for me.

                  M Offline
                  M Offline
                  mijutu
                  wrote on 1 Dec 2022, 08:44 last edited by
                  #8

                  @hamer There is check_for_ulimit function in qtwebengine/cmake/Functions.cmake but cmake 3.25 doesn't seem to notice it. Downgrading to cmake 3.24.3 helps.

                  1 Reply Last reply
                  0
                  • H hamer
                    30 Nov 2022, 09:39

                    If you want to use Qt 6 then you have to manually add the following to qtwebengine/configure.cmake:

                    if(QT_CONFIGURE_RUNNING)
                    
                        function(check_for_ulimit)
                        endfunction()
                    

                    At least, this fixed the problem for me.

                    A Offline
                    A Offline
                    abu_bua
                    wrote on 7 Dec 2022, 18:21 last edited by
                    #9

                    @hamer Thank you for sharing

                    1 Reply Last reply
                    0
                    • H hamer
                      30 Nov 2022, 09:39

                      If you want to use Qt 6 then you have to manually add the following to qtwebengine/configure.cmake:

                      if(QT_CONFIGURE_RUNNING)
                      
                          function(check_for_ulimit)
                          endfunction()
                      

                      At least, this fixed the problem for me.

                      C Offline
                      C Offline
                      cristi mcf
                      wrote on 8 Dec 2022, 13:29 last edited by
                      #10

                      @hamer said in Need help statically building qt for Ubuntu:

                      if(QT_CONFIGURE_RUNNING)

                      function(check_for_ulimit)
                      endfunction()
                      

                      it works, thanks

                      1 Reply Last reply
                      0
                      • J Offline
                        J Offline
                        jhcuarta
                        wrote on 2 Feb 2023, 02:16 last edited by
                        #11

                        Hi
                        I tried to manually edit the configure file but I failed. I got the error
                        ./configure: 31: Syntax error: word unexpected (expecting ")")
                        I quite dont posses expertise regarding programming and I dont Know how to edit it, any help please.
                        what line should be edit and how

                        srcpath=dirname $0
                        srcpath=(cd "$srcpath"; pwd)
                        configure=$srcpath/qtbase/configure
                        if [ ! -e "$configure" ]; then
                        echo "$configure not found. Did you forget to run "init-repository"?" >&2
                        exit 1
                        fi

                        set -ex

                        mkdir -p qtbase
                        cd qtbase

                        exec "$configure" -top-level "$@"

                        Best regards

                        jsulmJ 1 Reply Last reply 2 Feb 2023, 06:16
                        0
                        • J jhcuarta
                          2 Feb 2023, 02:16

                          Hi
                          I tried to manually edit the configure file but I failed. I got the error
                          ./configure: 31: Syntax error: word unexpected (expecting ")")
                          I quite dont posses expertise regarding programming and I dont Know how to edit it, any help please.
                          what line should be edit and how

                          srcpath=dirname $0
                          srcpath=(cd "$srcpath"; pwd)
                          configure=$srcpath/qtbase/configure
                          if [ ! -e "$configure" ]; then
                          echo "$configure not found. Did you forget to run "init-repository"?" >&2
                          exit 1
                          fi

                          set -ex

                          mkdir -p qtbase
                          cd qtbase

                          exec "$configure" -top-level "$@"

                          Best regards

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 2 Feb 2023, 06:16 last edited by
                          #12

                          @jhcuarta On what platform are you?
                          How did you get Qt source code?

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

                          1 Reply Last reply
                          0
                          • J Offline
                            J Offline
                            jhcuarta
                            wrote on 2 Feb 2023, 17:09 last edited by jhcuarta 2 Mar 2023, 17:34
                            #13

                            Sorry
                            I'm trying to install qt6 6.3.0, but I just modified the correct file, not the configuration file in the parent folder. Nevertheless I've installed version 6.2.4, having problems trying to finding correct installer. I'm using Ubuntu 22.04

                            J 1 Reply Last reply 5 Feb 2023, 22:14
                            0
                            • J jhcuarta
                              2 Feb 2023, 17:09

                              Sorry
                              I'm trying to install qt6 6.3.0, but I just modified the correct file, not the configuration file in the parent folder. Nevertheless I've installed version 6.2.4, having problems trying to finding correct installer. I'm using Ubuntu 22.04

                              J Offline
                              J Offline
                              jhcuarta
                              wrote on 5 Feb 2023, 22:14 last edited by
                              #14

                              @jhcuarta When iI try to configure I got the following error
                              jason@jason:/home/jason/Documents/qt-everywhere-src-6.3.0$ ./configure

                              • mkdir -p qtbase
                              • cd qtbase
                              • exec /home/jason/Documents/qt-everywhere-src-6.3.0/qtbase/configure -top-level
                                CMake Warning (dev) at qtbase/cmake/QtBuildInformation.cmake:167 (set):
                                Cannot set "__qt_configure_reports": current scope has no parent.
                                Call Stack (most recent call first):
                                qtsensors/src/sensors/configure.cmake:45 (qt_configure_add_report)
                                qtbase/cmake/QtProcessConfigureArgs.cmake:240 (include)
                                This warning is for project developers. Use -Wno-dev to suppress it.

                              CMake Error at qtwebengine/configure.cmake:623 (if):
                              Flow control statements are not properly nested.
                              Call Stack (most recent call first):
                              qtbase/cmake/QtProcessConfigureArgs.cmake:240 (include)

                              1 Reply Last reply
                              0
                              • S SGaist
                                10 Nov 2022, 19:22

                                Hi and welcome to devnet,

                                QtWebEngine cannot be built statically because the chromium project that powers it does not allow that.

                                That said, you should only build the modules you need rather than the full of Qt.

                                J Offline
                                J Offline
                                jiapei100
                                wrote on 6 Jun 2023, 12:18 last edited by
                                #15

                                @SGaist said in Need help statically building qt for Ubuntu:

                                Hi and welcome to devnet,

                                QtWebEngine cannot be built statically because the chromium project that powers it does not allow that.

                                That said, you should only build the modules you need rather than the full of Qt.

                                But how to ? Particularly, this annoying QtWebEngine?
                                I mean: how to disable the module QtWebEngine while building Qt from source (say: qt-everywhere-src-6.5.1) ?

                                Cheers

                                Welcome to Longer Vision
                                https://www.longervision.com

                                S 1 Reply Last reply 6 Jun 2023, 15:46
                                0
                                • J jiapei100
                                  6 Jun 2023, 12:18

                                  @SGaist said in Need help statically building qt for Ubuntu:

                                  Hi and welcome to devnet,

                                  QtWebEngine cannot be built statically because the chromium project that powers it does not allow that.

                                  That said, you should only build the modules you need rather than the full of Qt.

                                  But how to ? Particularly, this annoying QtWebEngine?
                                  I mean: how to disable the module QtWebEngine while building Qt from source (say: qt-everywhere-src-6.5.1) ?

                                  Cheers

                                  S Offline
                                  S Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on 6 Jun 2023, 15:46 last edited by
                                  #16

                                  @jiapei100 either delete the folder from the sources or use the --skip webengine option of the configure script. If you want to save time and space, only build the modules that you are actually using. You can always add others at a later stage if needed. Also, don't build the tests and examples.

                                  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
                                  0
                                  • JaneerJ Offline
                                    JaneerJ Offline
                                    Janeer
                                    wrote on 12 Jun 2023, 13:02 last edited by
                                    #17

                                    First, make sure you have all the necessary dependencies installed on your system. You can use the apt package manager to install them. Check the Qt documentation for the specific dependencies required for your version of Qt. Once you have the dependencies in place, download the source code for Qt and extract it to a directory of your choice. Then, open a terminal and navigate to the extracted directory. Next, you'll need to configure Qt with the appropriate options for static building. The configure script provides several flags to enable static building, such as -static and -static-runtime. You may also need to specify the path to the static version of any external libraries you want to include. After configuring, run make to start the build process. This may take a while, depending on the speed of your system.
                                    employee monitoring software

                                    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