<commit_before>Note
-----

For development the easiest way to get a working native windows build on a windows host is to use msys2, see instructions below.

If you are not planning to develop but only run the software you may find using WSL slightly easier or faster, the instructions below detail how to do this. However note the result is not a properly native binary but one that runs through the WSL 'emulation' layer.

It is also possible to cross compile for windows from a linux machine; this is how the official builds are done, see [regular build instructions](building.md) which can easily be altered to use a cross compiler.

It should also be possible to compile via msys or cygwin on windows, there are currently no detailed instructions for this, if you attempt this please consider contributing instructions so that others may benefit from your experience.

Binaries
-----
There are binaries for every release, please reconsider your need to build and unless you have a very good reason to do so rather just download these.
Latest binaries can always be found here: https://github.com/Gulden/gulden-official/releases
Download the latest linux*.tar.gz extract it and simply copy GuldenD out of it instead of going through the unnecessary hassle of building.


Installation of msys2
-----
* Download and run the 32 bit msys installer - www.msys2.org
* Open the msys2 32 bit console
* pacman -Syu
* Close and restart the console
* pacman -Su
* pacman -S --noconfirm mingw-w64-i686-toolchain mingw-w64-i686-python2 git make patch tar autoconf automake libtool


Building under msys2
-----
* cd /
* git clone https://github.com/Gulden/gulden-official
* cd gulden-official/depends
* make EXTRA_PACKAGES='qrencode protobuf native_protobuf'
* cp -rf C:/go/depends/work/staging/i686-pc-mingw32/qt/5.9.7-b11c9ab8f4b/msys32/go/depends/i686-pc-mingw32/* i686-pc-mingw32/
* cd ..
* ./autogen.sh
* mkdir buildwin
* cd buildwin
* CONFIG_SITE="$PWD/../depends/i686-pc-mingw32/share/config.site" CXXFLAGS="-I$PWD/../depends/i686-pc-mingw32/include -DZMQ_STATIC" LDFLAGS="-L$PWD/../depends/i686-pc-mingw32/lib" ../configure --prefix=$PWD/../depends/i686-pc-mingw32 --with-protoc-bindir=$PWD/../depends/i686-pc-mingw32/native/bin
* make


Installation of WSL
-----

First install the Windows Subsystem for Linux by opening PowerShell as Administrator and run:

`Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux`

Restart computer when prompted and then install Ubuntu from the following link

`https://www.microsoft.com/store/p/ubuntu/9nblggh4msv6`

Update and upgrade ubuntu within WSL

`sudo apt update && sudo apt upgrade`

Install build prerequisites, git and some build dependencies<commit_msg>Update documentation for building on Windows using msys2/mingw<commit_after>Note
-----

For development the easiest way to get a working native windows build on a windows host is to use msys2, see instructions below.

If you are not planning to develop but only run the software you may find using WSL slightly easier or faster, the instructions below detail how to do this. However note the result is not a properly native binary but one that runs through the WSL 'emulation' layer.

It is also possible to cross compile for windows from a linux machine; this is how the official builds are done, see [regular build instructions](building.md) which can easily be altered to use a cross compiler.

It should also be possible to compile via msys or cygwin on windows, there are currently no detailed instructions for this, if you attempt this please consider contributing instructions so that others may benefit from your experience.

Binaries
-----
There are binaries for every release, please reconsider your need to build and unless you have a very good reason to do so rather just download these.
Latest binaries can always be found here: https://github.com/Gulden/gulden-official/releases
Download the latest linux\*.tar.gz extract it and simply copy GuldenD out of it instead of going through the unnecessary hassle of building.


Installation of msys2
-----
* Download and run the 32 bit msys installer - www.msys2.org
* Open the *MSYS2 MinGW 32-bit* console (also called *Mingw-w64 32 bit* in the Mintty launcher)
* `pacman -Syu`
* Close and restart the console
* `pacman -Su`
* `pacman -S --noconfirm mingw-w64-i686-toolchain mingw-w64-i686-python2 git make patch tar autoconf automake libtool`


Building under msys2
-----
* `git clone https://github.com/Gulden/gulden-official`
* `cd gulden-official/depends`
* `make`
* `cd ..`
* `./autogen.sh`
* `mkdir buildwin`
* `cd buildwin`
* `CONFIG_SITE="$PWD/../depends/i686-pc-mingw32/share/config.site" CXXFLAGS="-I$PWD/../depends/i686-pc-mingw32/include -DZMQ_STATIC" LDFLAGS="-L$PWD/../depends/i686-pc-mingw32/lib" ../configure --prefix=$PWD/../depends/i686-pc-mingw32 --with-protoc-bindir=$PWD/../depends/i686-pc-mingw32/native/bin`
* `make`


Installation of WSL
-----

First install the Windows Subsystem for Linux by opening PowerShell as Administrator and run:

`Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux`

Restart computer when prompted and then install Ubuntu from the following link

`https://www.microsoft.com/store/p/ubuntu/9nblggh4msv6`

Update and upgrade ubuntu within WSL

`sudo apt update && sudo apt upgrade`

Install build prerequisites, git and some build dependencies
{'fraction_non_alphanumeric': 0.0854874446085672, 'fraction_numerical': 0.02326440177252585, 'mean_word_length': 4.178776290630975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2229508', 'n_tokens_mistral': 1717, 'n_tokens_neox': 1559, 'n_words': 659}