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. How do I compile a .exe file which I can run on any windows computer?
Forum Updated to NodeBB v4.3 + New Features

How do I compile a .exe file which I can run on any windows computer?

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
29 Posts 4 Posters 11.0k Views 2 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 StevenD
    PS C:\Qt-3.0.1\5.9.2\Src> ./configure.bat -opensource -confirm-license -nomake examples -nomake tests -static
    + cd qtbase
    + C:\Qt-3.0.1\5.9.2\Src\qtbase\configure.bat -top-level -opensource -confirm-license -nomake examples -nomake tests -static
    Bootstrapping qmake ...
    g++ -c -o project.o -DUNICODE -std=c++11 -ffunction-sections -g  -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/library -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/generators -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/generators/unix -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/generators/win32 -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/generators/mac -IC:/Qt-3.0.1/5.9.2/Src/qtbase/include -IC:/Qt-3.0.1/5.9.2/Src/qtbase/include/QtCore -IC:/Qt-3.0.1/5.9.2/Src/qtbase/include/QtCore/5.9.2 -IC:/Qt-3.0.1/5.9.2/Src/qtbase/include/QtCore/5.9.2/QtCore -I../src/corelib/global -IC:/Qt-3.0.1/5.9.2/Src/qtbase/mkspecs/win32-g++ -DQT_VERSION_STR=\"5.9.2\" -DQT_VERSION_MAJOR=5  -DQT_VERSION_MINOR=9  -DQT_VERSION_PATCH=2  -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH C:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/project.cpp
    mingw32-make: *** Error -1
    .  Stop.
    mingw32-make: *** Waiting for unfinished jobs....
    
    JKSHJ Offline
    JKSHJ Offline
    JKSH
    Moderators
    wrote on last edited by JKSH
    #19

    @StevenD said in How do I compile a .exe file which I can run on any windows computer?:

    PS C:\Qt-3.0.1\5.9.2\Src>
    

    I tried to build Qt with PowerShell a few months ago, but it failed. I didn't investigate why, but I suspect it's some kind of incompatibility between PowerShell and the old Batch files.

    cmd.exe worked for me; see if that helps you.

    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

    1 Reply Last reply
    0
    • S Offline
      S Offline
      StevenD
      wrote on last edited by
      #20

      cmd gives me almost identical output:

      C:\Qt-3.0.1\5.9.2\Src>configure -opensource -confirm-license -nomake examples -nomake tests -static
      + cd qtbase
      + C:\Qt-3.0.1\5.9.2\Src\qtbase\configure.bat -top-level -opensource -confirm-license -nomake examples -nomake tests -static
      Bootstrapping qmake ...
      g++ -c -o project.o -DUNICODE -std=c++11 -ffunction-sections -g  -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/library -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/generators -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/generators/unix -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/generators/win32 -IC:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/generators/mac -IC:/Qt-3.0.1/5.9.2/Src/qtbase/include -IC:/Qt-3.0.1/5.9.2/Src/qtbase/include/QtCore -IC:/Qt-3.0.1/5.9.2/Src/qtbase/include/QtCore/5.9.2 -IC:/Qt-3.0.1/5.9.2/Src/qtbase/include/QtCore/5.9.2/QtCore -I../src/corelib/global -IC:/Qt-3.0.1/5.9.2/Src/qtbase/mkspecs/win32-g++ -DQT_VERSION_STR=\"5.9.2\" -DQT_VERSION_MAJOR=5  -DQT_VERSION_MINOR=9  -DQT_VERSION_PATCH=2  -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH C:/Qt-3.0.1/5.9.2/Src/qtbase/qmake/project.cpp
      mingw32-make: *** Error -1
      .  Stop.
      mingw32-make: *** Waiting for unfinished jobs....
      
      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #21

        I'd first cleanup to ensure there's no remaining from your old build tentative.

        Also, consider doing out of source builds, that will simplify things if you want to build Qt for several architectures or make different static/shared builds.

        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
        • S Offline
          S Offline
          StevenD
          wrote on last edited by
          #22

          What should I clean up? Attempting to run mingw32-make clean results in mingw32-make: *** No rule to make target 'clean'. Stop.

          In addition, I do not see any additional files I should delete.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #23

            Because you are calling configure repeatedly with different options, so you should cleanup between invocation.

            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
            • S Offline
              S Offline
              StevenD
              wrote on last edited by
              #24

              I know I should clean, but what and how do I clean?

              jsulmJ 1 Reply Last reply
              0
              • S StevenD

                I know I should clean, but what and how do I clean?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by jsulm
                #25

                @StevenD You should start with fresh Qt source tree and do out of source build as @SGaist suggested.
                Out of source means:

                c:\qt_source
                mkdir c:\qt_build
                cd c:\qt_build
                ..\qt_source\configure.exe...
                make
                

                So, basically you call configure and make from outside of the Qt source code directory.
                In general you should read http://doc.qt.io/qt-5/build-sources.html

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

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  StevenD
                  wrote on last edited by
                  #26

                  Right, I now have a different problem:

                  C:\qt_build>..\Qt-3.0.1\5.9.2\Src\configure -opensource -confirm-license -nomake examples -nomake tests -static
                  + cd qtbase
                  + C:\Qt-3.0.1\5.9.2\Src\qtbase\configure.bat -top-level -opensource -confirm-license -nomake examples -nomake tests -static
                  Host platform 'win32-g++' is invalid. Aborting.
                  
                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #27

                    From a clean source ?
                    What command prompt are you using ?

                    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
                    • S Offline
                      S Offline
                      StevenD
                      wrote on last edited by
                      #28

                      I've tried using cmd and PowerShell, in that order. Both give the same ouput.

                      This may be a problem with Windows. I've recently started having... issues with it that are not related to Qt. Random applications suddenly can't run on my pc... I had this pop up with Qt Creator, Cygwin, and some other things.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #29

                        IIRC Windows latest updates may broke things in surprising ways.

                        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

                        • Login

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