Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. building a monolithic (standalone) program
Qt 6.12 LTS is out! See what's new in the release blog

building a monolithic (standalone) program

Scheduled Pinned Locked Moved Solved General and Desktop
20 Posts 6 Posters 7.7k Views 4 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by mzimmers
    #11

    The PS script installs into Qt/Static, or at least it's supposed to. I chose QtStatic before I realized the script used Qt/Static. According to my understanding of the web page, the script is supposed to download and populate that directory. I don't know why it's empty.

    I have source in C:\QtStatic\5.9.1\Src from downloading it myself (not through the script). I suppose I could move it to Qt\Static\5.9.1\Src and see what the script would do. I was just under the impression the script would take care of the download for me, so I'm not sure what to do now.

    1 Reply Last reply
    0
    • mzimmersM Offline
      mzimmersM Offline
      mzimmers
      wrote on last edited by
      #12

      Can anyone help me with the steps involved in building a static Qt library? The script doesn't seem to be working for me, and I'd really like to get this done.

      Thanks...

      kshegunovK 1 Reply Last reply
      0
      • mzimmersM mzimmers

        Can anyone help me with the steps involved in building a static Qt library? The script doesn't seem to be working for me, and I'd really like to get this done.

        Thanks...

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #13

        @mzimmers said in building a monolithic (standalone) program:

        script doesn't seem to be working for me, and I'd really like to get this done.

        I don't know much about newer windows-es but usually it's just enough to open a command prompt (ming32 command prompt or MSVS command prompt), go to the Qt dir, call configure with the appropriate arguments (which would include -static in your case) wait a bit and then do mingw32-make/nmake to build. Although providing the dependencies for windows is pretty finicky in my experience.

        Read and abide by the Qt Code of Conduct

        mzimmersM 1 Reply Last reply
        0
        • kshegunovK kshegunov

          @mzimmers said in building a monolithic (standalone) program:

          script doesn't seem to be working for me, and I'd really like to get this done.

          I don't know much about newer windows-es but usually it's just enough to open a command prompt (ming32 command prompt or MSVS command prompt), go to the Qt dir, call configure with the appropriate arguments (which would include -static in your case) wait a bit and then do mingw32-make/nmake to build. Although providing the dependencies for windows is pretty finicky in my experience.

          mzimmersM Offline
          mzimmersM Offline
          mzimmers
          wrote on last edited by
          #14

          @kshegunov by "the Qt dir" are you referring to the location of the source code?

          kshegunovK 1 Reply Last reply
          0
          • mzimmersM mzimmers

            @kshegunov by "the Qt dir" are you referring to the location of the source code?

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #15

            Yes, where the source code's been installed/downloaded.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            0
            • mzimmersM Offline
              mzimmersM Offline
              mzimmers
              wrote on last edited by
              #16

              OK I copied the configure command from the script and ran it manually. It worked once I removed the "-qt-sql-sqlite" switch.

              Now I'm ready to run make. If I run it from C:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1, though, that's where it will install it. I want it in Qt\Static. Is there a switch I can use on the make command to tell it to put Qt in Qt\Static? (I know this isn't a Qt question, but it does pertain to building/installing Qt.)

              Thanks...

              kshegunovK 1 Reply Last reply
              0
              • mzimmersM mzimmers

                OK I copied the configure command from the script and ran it manually. It worked once I removed the "-qt-sql-sqlite" switch.

                Now I'm ready to run make. If I run it from C:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1, though, that's where it will install it. I want it in Qt\Static. Is there a switch I can use on the make command to tell it to put Qt in Qt\Static? (I know this isn't a Qt question, but it does pertain to building/installing Qt.)

                Thanks...

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by kshegunov
                #17

                Rerun configure with -prefix /path/to/install and then you can proceed with building and installing.

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply
                0
                • mzimmersM Offline
                  mzimmersM Offline
                  mzimmers
                  wrote on last edited by
                  #18

                  OK, I did the configure, make and install. Seemed to work fine.

                  I tried adding the new version of Qt in the build/run settings in Creator, but I get a warning "no qmlscene installed." A bit of googling reveals that this can be solved in the Linux world by installing qtdeclarative5-dev. Unfortunately, I can find no such analog for Windows.

                  I also have a general message "Running Windows Runtime device detection. No winrtrunner.exe found." True enough, there's no such executable in my bin directory. Should I care about this?

                  1 Reply Last reply
                  0
                  • mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #19

                    @mzimmers said in building a monolithic (standalone) program:

                    No winrtrunner.exe found

                    Mine also says that. If you are making a desktop app it should have no ill effects.

                    1 Reply Last reply
                    1
                    • mzimmersM Offline
                      mzimmersM Offline
                      mzimmers
                      wrote on last edited by
                      #20

                      OK, I think I got this working. To recap, the advice on this page is very good. There are a few tweaks to the PowerShell that are needed for smooth sailing, though:

                      • the hard-coded default for the $QtSrcUrl variable is so old that it's not even on the download page anymore. Either pass it a different value using the "-QtSrcUrl" switch on the command line, or just edit it in the script.
                      • IMPORTANT use the zip file, not the tarball, when downloading the source. The script assumes a .zip file and forms some variable names based on the filename. If you use the tarball, it will extract successfully, but the script will fail downstream.
                      • the line:
                      $GccList = @(Get-ChildItem -Path C:\Qt\*\Tools\mingw*\bin\gcc.exe | ForEach-Object FullName | Sort-Object)
                      

                      doesn't work, at least not on Windows 10. I had to remove the "\*" from the path.

                      • in the invocation of configure.bat, I had to remove the "-qt-sql-sqlite" switch

                      • also in the invocation of configure.bat, you might want to modify the "-prefix $QtDir " to point somewhere else, unless you want your static libraries under the src directory.

                      Thanks again to everyone who helped with this.

                      1 Reply Last reply
                      3

                      • Login

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