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> ./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....
-
@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.
-
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....
-
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.
-
Because you are calling configure repeatedly with different options, so you should cleanup between invocation.
-
@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 -
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.
-
From a clean source ?
What command prompt are you using ? -
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.
-
IIRC Windows latest updates may broke things in surprising ways.