Skip to content

Instantly share code, notes, and snippets.

@ehsan18t
Last active September 22, 2024 19:32
Show Gist options
  • Save ehsan18t/8191a75270a14cbb472c0eb017db7f35 to your computer and use it in GitHub Desktop.
Save ehsan18t/8191a75270a14cbb472c0eb017db7f35 to your computer and use it in GitHub Desktop.
Install MinGW Effortlessly on Windows - A 2-Click Setup Guide

Introduction

In this blog post, I'm excited to introduce a recent project of mine aimed at simplifying the often intricate process of setting up and configuring the MinGW environment. It's no secret that navigating the complexities of MinGW installation can be daunting, especially for newcomers. Many budding developers find themselves overwhelmed and discouraged at this initial stage. With this project, my goal is to eliminate these barriers by providing a user-friendly MinGW installer. This installer is designed to streamline the process, equipping users with a fully functional environment that includes the latest GCC version and other essential production packages.

Packages

This installer is bundled with essential and commonly used packages which includes:

  • GCC
  • GDB
  • MinGW-w64 (linked with ucrt)
  • GNU Binutils
  • GNU Make
  • PExports
  • dos2unix
  • Yasm
  • NASM
  • JWasm
  • ccache
  • CMake
  • ninja
  • Doxygen
  • Universal Ctags
  • Cppcheck

Thread model: posix

Runtime library: UCRT (Windows 10 or higher, or when Update for Universal C Runtime is installed on older Windows versions, not supported on systems older than Windows 7 SP1 and Windows Server 2008 R2 SP1)

Installation Guide

  • Download the exe file from github release or webpage
  • Run the downloaded exe file.
  • Read Version Info (Optional)
  • Click Next
  • Click Install.

By following these simple steps, you'll complete the setup process, and your MinGW environment will be ready to use.

Thats it. You've successfully completed the setup.


Video Tutorial

Easy.MinGW.Installer.Tutorial.Project.mp4

Verification and Testing

To ensure your newly set up MinGW environment is functioning seamlessly, follow these quick verification steps:

  • Open terminal/cmd
  • Type gcc -v and hit Enter
  • You will see some texts and versions like below
    Using built-in specs.
    COLLECT_GCC=C:\MinGW64\bin\gcc.exe
    COLLECT_LTO_WRAPPER=C:/MinGW64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe
    OFFLOAD_TARGET_NAMES=nvptx-none
    Target: x86_64-w64-mingw32
    Configured with: ../configure --prefix=/R/winlibs64ucrt_stage/inst_gcc-13.2.0/share/gcc --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-offload-targets=nvptx-none --with-pkgversion='MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders' --with-tune=generic --enable-checking=release --enable-threads=posix --disable-sjlj-exceptions --disable-libunwind-exceptions --disable-serial-configure --disable-bootstrap --enable-host-shared --enable-plugin --disable-default-ssp --disable-rpath --disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs --disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++ --disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry --disable-multilib --enable-ld --enable-libquadmath --enable-libada --enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string --enable-libgomp --enable-graphite --enable-mingw-wildcard --enable-libstdcxx-time --enable-libstdcxx-pch --with-mpc=/d/Prog/winlibs64ucrt_stage/custombuilt --with-mpfr=/d/Prog/winlibs64ucrt_stage/custombuilt --with-gmp=/d/Prog/winlibs64ucrt_stage/custombuilt --with-isl=/d/Prog/winlibs64ucrt_stage/custombuilt --disable-libstdcxx-backtrace --enable-install-libiberty --enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto --enable-clocale=generic --with-libiconv --with-system-zlib --with-build-sysroot=/R/winlibs64ucrt_stage/gcc-13.2.0/build_mingw/mingw-w64 CFLAGS='-I/d/Prog/winlibs64ucrt_stage/custombuilt/include/libdl-win32 -Wno-int-conversion  -march=nocona -msahf -mtune=generic -O2' CXXFLAGS='-Wno-int-conversion  -march=nocona -msahf -mtune=generic -O2' LDFLAGS='-pthread -Wl,--no-insert-timestamp -Wl,--dynamicbase -Wl,--high-entropy-va -Wl,--nxcompat -Wl,--tsaware'
    Thread model: posix
    Supported LTO compression algorithms: zlib zstd
    gcc version 13.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders)
    

Remember the versions you see might be different from these depending on when you follow this post.

If the output matches above, congratulations! Your MinGW installation/setup is successfully done.

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