Skip to content

Instantly share code, notes, and snippets.

@abenevaut
Last active February 13, 2026 20:47
Show Gist options
  • Select an option

  • Save abenevaut/c7bd0b6b19c80742c5632e57cc76191d to your computer and use it in GitHub Desktop.

Select an option

Save abenevaut/c7bd0b6b19c80742c5632e57cc76191d to your computer and use it in GitHub Desktop.
sudo apt install -y \
  autoconf automake autopoint bash bison \
  build-essential bzip2 flex g++ g++-multilib \
  gettext git gperf intltool libffi-dev \
  libgdk-pixbuf-2.0-dev libltdl-dev libssl-dev \
  libtool-bin lzip make p7zip-full patch \
  perl python3 python3-mako python3-pkg-resources \
  ruby sed unzip wget xz-utils cmake ninja-build git wget

cd ~

git clone https://github.com/mxe/mxe.git

cd mxe

make MXE_TARGETS='x86_64-w64-mingw32.static i686-w64-mingw32.static'

echo 'export PATH="$HOME/mxe/usr/bin:$PATH"' >> ~/.bashrc source ~/.bashrc

test x86_64-w64-mingw32.static-g++ --version i686-w64-mingw32.static-g++ --version

echo '#include <iostream>
int main(){std::cout<<"Hello";}' > test.cpp

i686-w64-mingw32.static-g++ test.cpp -o test.exe

make zlib MXE_TARGETS='i686-w64-mingw32.static'

make MXE_TARGETS='x86_64-w64-mingw32.static i686-w64-mingw32.static'

x64 make -j$(nproc) MXE_TARGETS='x86_64-w64-mingw32.static' cc

x32 make -j$(nproc) MXE_TARGETS='i686-w64-mingw32.static' cc

@abenevaut
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment