Quantcast
Channel: Qt DevNet forums: Installation and Deployment
Viewing all articles
Browse latest Browse all 2113

How to build Qt 5.4 statically on Window 7. Compression exe by upx

$
0
0
Hello! I built Qt 5.4 successfully. I receive exe files at the minimum 14 MBytes. I compress them to ~5.5 MBytes by upx.exe This is my instruction: Change the file: C:\Qt\Qt5.4.0\5.4\mingw491_32\mkspecs\win32-g++\qmake.conf QMAKE_LFLAGS += -static-libgcc -static -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc DEFINES += QT_STATIC_BUILD Open the terminal: “Start” -> “All Programs” -> “Qt 5.4.0” -> “5.4” -> “MinGW 4.9 (32 bit)” -> “Qt 5.4.0 for Desktop (MinGW 4.9 32 bit)” cd C:\Qt\Qt5.4.0\5.4\Src\ configure -static -platform win32-g++ -prefix “C:\Qt\Qt5.4.0_Static” -release -opensource -confirm-license -nomake examples -nomake tests -nomake tools -opengl desktop -no-angle -qt-sql-sqlite -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype mingw32-make mingw32-make install You will have a static Qt here “C:\Qt\Qt5.4.0_Static” Reinstall Qt - Run QtCreator - In the menu select “Tools” -> select “Options” - Select “Build & Run” -> select “Qt Vertions” - Click the button “Add…” -> select “C:\Qt\Qt5.4.0_Static\bin\qmake.exe” - Click the button “Apply” - Select “Kits” -> click the button “Add” - Write in the filed “Name”: Desktop Qt 5.4.0 Static MinGW 32 bit - If the field “Debugger” is empty, click the button “Manage…” - Click the button “Add” -> write the name (for example gdb) -> select “C:\Qt\Qt5.4.0\Tools\mingw49_32\bit\gdb.exe” - Click the button “Apply” - Select “Kits” - Select in the list “Qt versions”: “Desktop Qt 5.4.0 Static MinGW 32 bit” - Click the button “OK”

Viewing all articles
Browse latest Browse all 2113

Trending Articles