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. *still* having problems building Qt (static)
Forum Update on Monday, May 27th 2025

*still* having problems building Qt (static)

Scheduled Pinned Locked Moved Solved Installation and Deployment
22 Posts 4 Posters 1.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.
  • B B3lette
    24 Apr 2020, 16:10

    @mzimmers said in *still* having problems building Qt (static):

    @B3lette I do have those components installed, and my path includes the bin directory. The file direct.h is in C:\Qt\Tools\mingw730_32\i686-w64-mingw32\include; are you saying that I have to add the include directory to my path as well?

    Thanks...

    No it should be ok ... So it doesn't seem to come from your minGW installation process.
    Is "sh.exe" in your path ? See : https://bugreports.qt.io/browse/QTBUG-28845
    I'm not sure about your c:\ in prefix either, maybe it should be relative to the partition's root, like "-prefix qt5\5.14.2\static"

    @mzimmers said in *still* having problems building Qt (static):

    @jsulm thanks for that link, but I'm still unclear on something -- how did you navigate to that path? What I mean is, what is the URL to get to that page?

    Click on :

    • "Download. Try. Buy" on the upper right hand corner on any qt page
    • In the category "Downloads for open source users", click on "Go open source"
    • Scroll all the way down to the link "Download the Qt Online Installer"
    M Offline
    M Offline
    mzimmers
    wrote on 24 Apr 2020, 16:22 last edited by
    #13

    @B3lette thanks for the direction to the download page.

    I do have sh.exe in my path. The procedure I listed above used to work. I decided to re-install Qt from scratch. I'm now doing the submodule update step, which takes a long time, probably because I didn't exclude any submodules (I need to learn how to do that). When it's done, I'll try the configure command again.

    Thanks...

    1 Reply Last reply
    0
    • B Offline
      B Offline
      B3lette
      wrote on 24 Apr 2020, 16:27 last edited by
      #14

      No problem, I am currently completely studying the same things and thought I could help here ...
      See https://wiki.qt.io/Building_Qt_5_from_Git#Getting_the_submodule_source_code for infos on init-repository.
      Personally i did --module-subset=essential,-qtdoc because that was what I needed.

      M 1 Reply Last reply 24 Apr 2020, 17:03
      0
      • B B3lette
        24 Apr 2020, 16:27

        No problem, I am currently completely studying the same things and thought I could help here ...
        See https://wiki.qt.io/Building_Qt_5_from_Git#Getting_the_submodule_source_code for infos on init-repository.
        Personally i did --module-subset=essential,-qtdoc because that was what I needed.

        M Offline
        M Offline
        mzimmers
        wrote on 24 Apr 2020, 17:03 last edited by
        #15

        @B3lette oh, I guess that's one of the advantages of using the init-repository script -- you can include/exclude the modules as desired.

        I'd be interested to know whether, after you've built a Qt library, whether you can go back and add modules should the need arise. Qt's build system has been known to be a little fussy in the past.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mzimmers
          wrote on 24 Apr 2020, 18:06 last edited by
          #16

          UPDATE: after going through the procedure again, but using the init-repository script, the configure failed again, just as noted above. Then I read the fine print:

          ../qt5/configure

          and inferred from it that the configure command must be using its own relative pathnames to find files like direct.h. So I ran from my already-installed Qt instead, and the configure command succeeded. Now, we'll see how the build does.

          Progress, anyway...

          M 1 Reply Last reply 23 Mar 2025, 16:05
          0
          • B Offline
            B Offline
            B3lette
            wrote on 24 Apr 2020, 19:15 last edited by B3lette
            #17

            Ok, happy it succeeded !

            Qt building is meant to be made shadow : after your checkout and repo init, you should create another directory, cd into it and call configure from it.
            See my first post here for a nice batch script doing it : https://forum.qt.io/topic/113984/cross-compilation-from-windows-to-aarch64

            M 1 Reply Last reply 24 Apr 2020, 19:39
            1
            • B B3lette
              24 Apr 2020, 19:15

              Ok, happy it succeeded !

              Qt building is meant to be made shadow : after your checkout and repo init, you should create another directory, cd into it and call configure from it.
              See my first post here for a nice batch script doing it : https://forum.qt.io/topic/113984/cross-compilation-from-windows-to-aarch64

              M Offline
              M Offline
              mzimmers
              wrote on 24 Apr 2020, 19:39 last edited by
              #18

              @B3lette yeah, I'm still not sure if I fully understand all that's going on, but evidently, not only do you have to build into another directory, but you have to use the configure command that exists within the already-built Qt space.

              Anyway, the make and make install worked, and I have my static build.

              Thanks to everyone who looked and helped.

              1 Reply Last reply
              0
              • M mzimmers
                24 Apr 2020, 18:06

                UPDATE: after going through the procedure again, but using the init-repository script, the configure failed again, just as noted above. Then I read the fine print:

                ../qt5/configure

                and inferred from it that the configure command must be using its own relative pathnames to find files like direct.h. So I ran from my already-installed Qt instead, and the configure command succeeded. Now, we'll see how the build does.

                Progress, anyway...

                M Offline
                M Offline
                Mr.Anubis
                wrote on 23 Mar 2025, 16:05 last edited by
                #19

                @mzimmers said in *still* having problems building Qt (static):

                and inferred from it that the configure command must be using its own relative pathnames to find files like direct.h. So I ran from my already-installed Qt instead, and the configure command succeeded. Now, we'll see how the build does.

                exactly what steps did you take to solve this? Thanks

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mzimmers
                  wrote on 23 Mar 2025, 16:09 last edited by
                  #20
                  1. Make sure that PATH includes paths to:
                  • the toolchain (eg, C:\qt\tools\mingw1120_64\bin)
                  • a Ninja (eg, C:\Program Files\ninja-win)
                  1. Create and enter the directory you want for your static build.

                  2. Use the following configure command:

                  C:/Qt/6.8.2/Src/configure.bat -prefix c:/qt_static/6.8.2 -static -static-runtime -release -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtdatavis3d -skip qtdoc -skip qtgrpc -skip qtinsighttracker -skip qtmultimedia -skip qtgraphs -skip qtcharts -skip qtquick3d -skip qtquick3dphysics -skip qtquicktimeline -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qtcoap -skip qtspeech -redo

                  (of course, you'll want to select your own "-skip" modules)
                  4. cmake --build . --parallel

                  1. cmake --install .
                  M 1 Reply Last reply 23 Mar 2025, 16:15
                  0
                  • M mzimmers
                    23 Mar 2025, 16:09
                    1. Make sure that PATH includes paths to:
                    • the toolchain (eg, C:\qt\tools\mingw1120_64\bin)
                    • a Ninja (eg, C:\Program Files\ninja-win)
                    1. Create and enter the directory you want for your static build.

                    2. Use the following configure command:

                    C:/Qt/6.8.2/Src/configure.bat -prefix c:/qt_static/6.8.2 -static -static-runtime -release -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtdatavis3d -skip qtdoc -skip qtgrpc -skip qtinsighttracker -skip qtmultimedia -skip qtgraphs -skip qtcharts -skip qtquick3d -skip qtquick3dphysics -skip qtquicktimeline -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qtcoap -skip qtspeech -redo

                    (of course, you'll want to select your own "-skip" modules)
                    4. cmake --build . --parallel

                    1. cmake --install .
                    M Offline
                    M Offline
                    Mr.Anubis
                    wrote on 23 Mar 2025, 16:15 last edited by Mr.Anubis
                    #21

                    @mzimmers Thanks a lot :)

                    could you figure out why didn't "../qt5/configure" work? and what did you infer exactly why it was not working

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mzimmers
                      wrote on 23 Mar 2025, 16:26 last edited by
                      #22

                      I'm sorry, but it's been too long ago. There have been so many changes in Qt since then, it very well may work now, but my procedure works correctly, so I haven't been motivated to experiment.

                      In fact, I don't think I'm even using github for my Qt source files any longer, but am obtaining them through the Qt maintenance tool. So, there are alternatives to my method.

                      1 Reply Last reply
                      1

                      • Login

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