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
Forum Updated to NodeBB v4.3 + New Features

Need help statically building qt for Ubuntu

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
17 Posts 10 Posters 5.1k 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.
  • H Offline
    H Offline
    hamer
    wrote on 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
    3
    • H hamer

      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 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

        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 last edited by
        #9

        @hamer Thank you for sharing

        1 Reply Last reply
        0
        • H hamer

          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 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 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
            0
            • J jhcuarta

              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 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 last edited by jhcuarta
                #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
                0
                • J jhcuarta

                  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 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
                  • SGaistS SGaist

                    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.

                    jiapei100J Offline
                    jiapei100J Offline
                    jiapei100
                    wrote on 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

                    SGaistS 1 Reply Last reply
                    0
                    • jiapei100J jiapei100

                      @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

                      SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 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 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