In this tutorial, you configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger from mingw-w64 to create programs that run on Windows. After configuring VS Code, you will compile, run, and debug a Hello World program.
If you have Visual Studio or WSL installed, you might need to change compilerPath to match the preferred compiler for your project. For example, if you installed MinGW-w64 version 8.1.0 using the i686 architecture, Win32 threading, and sjlj exception handling install options, the path would look like this: C:\Program Files (x86)\mingw-w64\i686-8.1.0-win32-sjlj-rt_v6-rev0\mingw64\bin\g++.exe.
You must follow the steps on the MSYS2 website to use the MSYS CLI to install the full MinGW-w64 toolchain(pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain), as well as all required prerequisites. The toolchain includes g++ and gdb.
Most languages supported by GCC are supported on the Mingw-w64 port as well. These include C, C++, Objective-C, Objective-C++, Fortran, and Ada. The GCC runtime libraries are used (libstdc++ for C++, libgfortran for Fortran, etc.). A packaging of LLVM's clang to mingw-w64 is also provided by MSYS2. It supports ARM for Windows (aarch64-w64-mingw32 and armv7-w64-mingw32).[10][11]
Finally located a compiled binary (good enough for my purposes) that will work. Here is the 64 bit binary for linux (prebuilt, just DL, and unpack it and upload the tar to the box). You will need to create an /opt/mingw64 directory and untar the file in that directory (sudo tar -xvf /mingw-w64-bin_x86_64-linux_20131228.tar) for ex. -w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/ -for-windows-on-linux/
It consists of a command line terminal calledmintty, bash, version control systems like git andsubversion, tools like tar and awk and even build systems like autotools, allbased on a modified version of Cygwin. Despite some ofthese central parts being based on Cygwin, the main focus of MSYS2 is to providea build environment for native Windows software and the Cygwin-using parts arekept at a minimum. MSYS2 provides up-to-date native builds for GCC, mingw-w64,CPython, CMake, Meson, OpenSSL, FFmpeg, Rust, Ruby, just to name a few.
As you can see, if you need other mingw64 builds of programs (toolchain programs or not), their package names would be prefixed with mingw-w64-x86_64-. There's also the package group mingw-w64-x86_64-toolchain which you can pacman -S --needed instead to get a somewhat full toolchain.
See this comments concerning the SO version:
github.com/msys2/MINGW-packages Build HDF5 1.14.0 for mingw-w64 by mkitti on 01:35AM - 13 Jan 23 4 commits changed 4 files with 14 additions and 92 deletions.
GPG key has issues or is too new or something like that. I just did a 10-month old system upgrade with thousands of packages without problems, besides steam not working... I realize I need the lib32 packages, but now when I try to install Proton, mingw-w64-tools is the only package out of thousands of others (and a gpg keyserver update, and all that's needed there)
You can use the vcpkg mingw community triplets with toolchains on non-Windows computers to cross-compile software to be run on Windows. Many Linux distributions offer such toolchains in optional packages with a mingw-w64 suffix or prefix. As an example, for Debian-based distributions, you would start with this installation command for the x64 toolchain:
Open your msys2 shell and run "pacman -S mingw-w64-x86_64-portaudio". This will get you a default build of PortAudio. I believe it comes with DirectSound, WASAPI, WD/MKS, WD/MKS_DEVICE_INFO, and WMME. Note the "-x86_64" in the middle of the package name. When you install msys2 packages, you specify the toolchain name in the middle, and "-x86_64" chooses the msvcrt-gcc toolchain.
A package for mingw-w64 should be named mingw-w64-pkgname. If a static variant of the package is being built, suffix the package name with -static (see below for the cases where this is necessary).
Always try to match the pkgver in your mingw-w64 packages to the pkgver of the corresponding regular packages in the official Arch Linux repos (not the testing repos). This ensures that the cross-compiled software works exactly the same way on Windows without any unexpected bugs. If packages in Arch are out-of-date, there usually is a good reason and you should still follow the Arch version instead of using the most recent upstream release. If the corresponding native package is in the AUR, you need not follow this version policy, as many AUR packages are often orphaned or left unmaintained.
08ab062aa8