-
Notifications
You must be signed in to change notification settings - Fork 17
Build from Windows to Windows 64 bit Static
There are three steps for building static QML app from Windows to Windows 64-bit :
MSYS2 is a software distro and building platform for Windows. It provides a bash shell, revision control systems and other tools for building native Windows applications using MinGW-w64 toolchains. It also feature pacman
package manager which makes installations process really easy.
-
Download the latest version of MSYS2 from the official homepage. Choose MSYS2 version that compatible with your system's architecture. Run it and follow the installation instructions. In this tutorial, I installed it to
C:\msys64
. -
Open Mingw-w64 terminal, then install
qt5
and its dependencies :pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-jasper mingw-w64-x86_64-openssl mingw-w64-x86_64-qt5-static
-
Now static Qt5 for Windows 64-bit has been installed.
Once Qt installed, we need to create a new profile for qamel
. In this tutorial, we will create a profile named msys2_64_static
by running :
qamel profile setup msys2_64_static
The command above will ask you to submit the information about your OS, build mode, and path to the Qt that you've installed before. Once finished, it should look like this :
Thanks for using qamel, QML's binding for Go.
Please specify the target OS for this profile. Possible values are "windows", "linux" and "darwin".
Keep it empty to use your system OS.
Target OS (default windows) : windows
Please specify the target architecture for this profile. Possible values are "386" and "amd64".
Keep it empty to use your system architecture.
Target arch (default amd64) : amd64
Please specify whether this profile used to build static or shared app.
Use static mode (y/n, default n) : y
Please specify the *full path* to your Qt's tools directory.
This might be different depending on your platform or your target. For example, in Linux with Qt 5.11.1, the tools are located in $HOME/Qt5.11.1/5.11.1/gcc_64/bin/
Qt tools dir : C:\msys64\mingw64\qt5-static\bin
qmake : found
moc : found
rcc : found
Please specify the *full path* to your compiler.
Keep it empty to use the default compiler on your system.
C compiler (default gcc.exe) : C:\msys64\mingw64\bin\gcc.exe
C++ compiler (default g++.exe) : C:\msys64\mingw64\bin\g++.exe
Since you are targeting Windows, you might want to set icon for your executable file. To do so, please specify the *full path* to windres on your system. It's usually located in the directory where MinGW is installed.
Path to windres : C:\msys64\mingw64\bin\windres.exe
Generating some code for binding...done
Saving profile msys2_64_static...done
Setup finished.
Now you can get started on your own QML app.
Once static Qt installed and the profile created, the last thing to do is to build our qamel
app. To do that, run qamel build
using profile that we've created before :
qamel build -p msys2_64_static