(C++) How to cross-compile a Qt Creator project from Ubuntu to a windows executable: example 4: any application, changing makefile

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) How to cross-compile a Qt Creator project from Ubuntu to a windows executable: example 4: any application, changing makefile

 

This is example 4, and a failed attempt of answering the Qt FAQ How to cross-compile a Qt Creator project from Ubuntu to a windows executable?.

 

 

 

 

 

Project information

 

The project is a standard Hello World program.

 

 

 

 

 

Process

 

Running the following command in the same folder as the .pro file, generates some makefiles:

 


qmake-qt4 -spec win32-g++

 

As [1] indicated, I also typed the following:

 


QMAKESPEC=win32-g++ qmake-qt4 QT_LIBINFIX=4

And then I typed:

 


make

 

Screen output:

 


make -f Makefile.Release make[1]: Entering directory `/home/richel/qtsdk-2010.04/bin/Projects/Website/CppQtCrosscompileToWindowsExample4' /usr/bin/uic.exe dialog.ui -o ui_dialog.h make[1]: /usr/bin/uic.exe: Command not found make[1]: *** [ui_dialog.h] Error 127 make[1]: Leaving directory `/home/richel/qtsdk-2010.04/bin/Projects/Website/CppQtCrosscompileToWindowsExample4' make: *** [release] Error 2

 

[ui_dialog.h] Error 127 is a known (yet unsolved) error.

 

 

 

 

 

References

 

 

 

 

 

[1] http://lukast.mediablog.sk/log/?p=155

 


This approach seems to result in an invalid Windows executable