Skip to content

Deploying Linux to Windows 32 bit Static

Radhi edited this page Aug 16, 2017 · 7 revisions

There are two ways to deploy from Linux to Windows 32-bit, using docker image or using cross compiler.

Using Docker Image

This method is more recommended because it's easier and doesn't require you to install additional packages on your system.

  1. Make sure you already installed docker on your system.

  2. Pull docker image for Windows 32-bit :

    docker pull therecipe/qt:windows_32_static
    
  3. Deploy your app :

    qtdeploy -docker build windows_32_static
    

Once the deployment finished, you can start your application by running the executable file that located in folder deploy/windows at your project's root directory.

Using Cross Compiler

You might want to use this method if you are planning on using the latest version of Qt. This method works by using Wine and MXE, so make sure you installed both of them in your system. Here are the steps for Debian and its derivatives :`

  1. Install Wine :

    sudo apt-get -y install wine
    
  2. Add MXE to your local repository :

    echo "deb https://pkg.mxe.cc/repos/apt/debian wheezy main" | sudo tee --append /etc/apt/sources.list.d/mxeapt.list > /dev/null
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D43A795B73B16ABE9643FE1AFD8FFF16DB45C6AB
    sudo apt-get update
    
  3. Install MXE and its Qt packages :

    sudo apt-get -y -qq install mxe-i686-w64-mingw32.static-qt3d mxe-i686-w64-mingw32.static-qtactiveqt mxe-i686-w64-mingw32.static-qtbase mxe-i686-w64-mingw32.static-qtcanvas3d mxe-i686-w64-mingw32.static-qtcharts mxe-i686-w64-mingw32.static-qtconnectivity mxe-i686-w64-mingw32.static-qtdatavis3d mxe-i686-w64-mingw32.static-qtdeclarative mxe-i686-w64-mingw32.static-qtgamepad mxe-i686-w64-mingw32.static-qtgraphicaleffects mxe-i686-w64-mingw32.static-qtimageformats mxe-i686-w64-mingw32.static-qtlocation mxe-i686-w64-mingw32.static-qtmultimedia mxe-i686-w64-mingw32.static-qtofficeopenxml mxe-i686-w64-mingw32.static-qtpurchasing mxe-i686-w64-mingw32.static-qtquickcontrols mxe-i686-w64-mingw32.static-qtquickcontrols2 mxe-i686-w64-mingw32.static-qtscript mxe-i686-w64-mingw32.static-qtscxml mxe-i686-w64-mingw32.static-qtsensors mxe-i686-w64-mingw32.static-qtserialbus mxe-i686-w64-mingw32.static-qtserialport mxe-i686-w64-mingw32.static-qtservice mxe-i686-w64-mingw32.static-qtsvg mxe-i686-w64-mingw32.static-qtsystems mxe-i686-w64-mingw32.static-qttools mxe-i686-w64-mingw32.static-qttranslations mxe-i686-w64-mingw32.static-qtvirtualkeyboard mxe-i686-w64-mingw32.static-qtwebchannel mxe-i686-w64-mingw32.static-qtwebsockets mxe-i686-w64-mingw32.static-qtwinextras mxe-i686-w64-mingw32.static-qtxlsxwriter mxe-i686-w64-mingw32.static-qtxmlpatterns
    
  4. Export environment variable QT_MXE_ARCH=386 and QT_MXE_STATIC=true.

  5. Run qtsetup if you haven't done it before.

  6. Deploy your app :

    qtdeploy build windows
    

Once the deployment finished, you can start your application by running the executable file that located in folder deploy/windows at your project's root directory.

Clone this wiki locally