Skip to content

Deploying Linux to Windows 64 bit Static

5k3105 edited this page Mar 24, 2022 · 8 revisions

Docker deployment

docker pull therecipe/qt:windows_64_static
  • Deploy your application
qtdeploy -docker build windows_64_static

You should find your deployed application inside the deploy subfolder.

Note, if running docker as root, add GOPATH to sudo env (substitute [local gopath] with your GOPATH):

sudo env "GOPATH=[local gopath]" qtdeploy -docker build windows_64_static

Using go version go1.17, go modules may be required. If you normally use GO111MODULE=off, you can go mod init and then qtdeploy to docker.

You can also change permissions for docker so you don't need to use sudo:

sudo setfacl --modify user:<user account name>:rw /var/run/docker.sock

MXE deployment under Debian/Ubuntu (pre-built)

  • Install Wine if you want to test your Windows application on Linux
sudo apt-get -y install wine
  • Add MXE to your local repository
echo "deb http://pkg.mxe.cc/repos/apt trusty main" | sudo tee --append /etc/apt/sources.list.d/mxeapt.list > /dev/null
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9
sudo apt-get update
  • Install MXE's version of Qt
sudo apt-get --no-install-recommends -qq -y install mxe-x86-64-w64-mingw32.static-qt3d mxe-x86-64-w64-mingw32.static-qtactiveqt mxe-x86-64-w64-mingw32.static-qtbase mxe-x86-64-w64-mingw32.static-qtcanvas3d mxe-x86-64-w64-mingw32.static-qtcharts mxe-x86-64-w64-mingw32.static-qtconnectivity mxe-x86-64-w64-mingw32.static-qtdatavis3d mxe-x86-64-w64-mingw32.static-qtdeclarative mxe-x86-64-w64-mingw32.static-qtgamepad mxe-x86-64-w64-mingw32.static-qtgraphicaleffects mxe-x86-64-w64-mingw32.static-qtimageformats mxe-x86-64-w64-mingw32.static-qtlocation mxe-x86-64-w64-mingw32.static-qtmultimedia mxe-x86-64-w64-mingw32.static-qtofficeopenxml mxe-x86-64-w64-mingw32.static-qtpurchasing mxe-x86-64-w64-mingw32.static-qtquickcontrols mxe-x86-64-w64-mingw32.static-qtquickcontrols2 mxe-x86-64-w64-mingw32.static-qtscript mxe-x86-64-w64-mingw32.static-qtscxml mxe-x86-64-w64-mingw32.static-qtsensors mxe-x86-64-w64-mingw32.static-qtserialbus mxe-x86-64-w64-mingw32.static-qtserialport mxe-x86-64-w64-mingw32.static-qtservice mxe-x86-64-w64-mingw32.static-qtsvg mxe-x86-64-w64-mingw32.static-qtsystems mxe-x86-64-w64-mingw32.static-qttools mxe-x86-64-w64-mingw32.static-qttranslations mxe-x86-64-w64-mingw32.static-qtvirtualkeyboard mxe-x86-64-w64-mingw32.static-qtwebchannel mxe-x86-64-w64-mingw32.static-qtwebsockets mxe-x86-64-w64-mingw32.static-qtwinextras mxe-x86-64-w64-mingw32.static-qtxlsxwriter mxe-x86-64-w64-mingw32.static-qtxmlpatterns
  • Export the environment variable QT_API=5.8.0
  • Export the environment variable QT_MXE=true, QT_MXE_ARCH=amd64 and QT_MXE_STATIC=true
  • If you haven't already, run the setup for windows
qtsetup full windows
  • Deploy your app
qtdeploy build windows

You should find your deployed application inside the deploy subfolder.

MXE deployment under Debian/Ubuntu (self-compiled)

TODO

Clone this wiki locally