I install msys2 with here.
I download i686-5.3.0-release-posix-dwarf-rt_v4-rev0 from here.
after setup msys2-i686-20160205.exe, extract i686-5.3.0-release-posix-dwarf-rt_v4-rev0 in C:\msys32.
finally i run MinGW-w64 Win32 Shell from start menu and run these commands respectively:
pacman -Sy pacman
pacman -Syu
pacman -Su
Add C:\msys32\mingw32\bin in PATH.
my question:
Thanks in advance.
Former msys2 & arch linux user here, currently enrolled in college where the class uses codeblocks as the standard metric for whether a program works or not, and I think I can help you here.
The basic gist is you'd want to install msys2 normally, as well as codeblocks, then use the codeblocks settings to set your compiler to use msys2's mingw-w64 compiler. Confused yet? Its pretty simple overall.
C:\msys64
for 64 bit and I think C:\msys32
for 32 bit; we'll assume 64 bit for the rest of this guide). Take note of wherever you do install it, we'll need it later.$ pacman -Syu
; it will update a smallish subset of available packages and ask you to close the window.$ pacman -Syu
; this time the list will be much larger.base-devel
package group $ pacman -Syu base-devel
; it will prompt you with a list of packages in the group. You want to skip pacman itself, otherwise it will have the same two-part update thing. Last time I checked this, pacman was number 39 on the list, so you'd put in 1-38,40-56
for what to install (adjust for whatever $currentdate
offers you, it may not always be 39).pacman -Syu mingw-w64-x86_64-toolchain
, it will again prompt you with a choice of packages, you want them all so just hit enter. If you want the 32-bit toolchain you'd use pacman -Syu mingw-w64-i686-toolchain
.GNU GCC Compiler
. Under that setting there should be a button to copy it. Give the new compiler profile a descriptive name (I went with MSYS2 mingw-w64-x86_64 G++
. It will prompt you to update the toolchain executables.Toolchain executables
, click it. Set the Compiler's installation directory
to wherever you installed msys2 to + either mingw64 for a 64-bit toolchain or mingw32 for a 32-bit toolchain. Assuming default install location and a 64-bit toolchain, this should be C:\msys64\mingw64
.Program Files
to remove the mingw32-
prefix, except for Make program
which must remain mingw32-make.exe
. Everything else should have flat names (gcc.exe
,g++.exe
, etc).Settings->Compiler
window.I've created a youtube video showing the whole process, since I've not yet seen this documented anywhere on the internet.
I too had the question #2: "what difference between MinGW-w64 Win32 Shell and MSYS2 Shell?". I found the answer to it on this official wiki page. For the original complete formatting, please see the original page. Here is the relevant part of the page, as of 9th August of 2017.
MSYS2 susbsystems
MSYS2 consists of three subsystems and their corresponding package repositories, msys2, mingw32, and mingw64.
The mingw subsystems provide native Windows programs and are the main focus of the project. These programs are built to co-operate well with other Windows programs, independently of the other subsystems.
The msys2 subsystem provides an emulated mostly-POSIX-compliant environment for building software, package management, and shell scripting. These programs live in a virtual single-root filesystem (the root is the MSYS2 installation directory). Some effort is made to have the programs work well with native Windows programs, but it's not seamless.
Each of the subsystems provides its own native (i.e. target=host) compiler toolchain, in msys2-devel, mingw-w64-i686-toolchain, and mingw-w64-x86_64-toolchain. There are also cross compiler toolchains with host={i686,x86_64}-pc-msys and target={i686,x86_64}-w64-mingw32 in mingw-w64-cross-toolchain, but these are of limited use because there are no library packages for them.
Shells
Every subsystem has an associated "shell", which is essentially a set of environment variables that allow the subsystems to co-operate properly. These shells can be invoked using launchers in the MSYS2 installation directory or using the shortcuts in the Windows Start menu. The launchers set the MSYSTEM variable and open a terminal window (mintty) with a proper shell (bash). Bash in turn sources /etc/profile which sets the environment depending on the value of MSYSTEM. Without the correct environment, various things may and will (sometimes silently) break. The exception is using mingw subsystems from pure Windows, which shouldn't require any special environment apart from an entry in PATH. Do not set MSYSTEM outside of the shells, because that will also break things.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With