Install the Mingw and the Cygwin C/C++ compilers under windows

 

Two options for compiling C and C++ , and other kinds of source code files under windows , are : the cygwin-gcc compiler , and the mingw-gcc compiler .

For source code , that uses the posix api , the cygwin-gcc compiler can be used , it provides a substantial implementation of the posix api , provided by the cygwin1.dll library .

cygwin-gcc , can also be used to compile source code , which uses the windows api . In both cases , the cygwin1.dll library , must be made available to the executing program .

For source code , that only uses the windows api , the mingw-gcc compiler can be used . The produced executable , does not depended on cygwin1.dll , it just depends on windows libraries .

To install these compilers , two unix like environment , which provide unix commands in the form of windows executables , are available , the first one is the Cygwin environment , and the second one is MSYS2 environment .

Both environment , provide both compilers , the MSYS2 environment provides a package manager , pacman , that allows the installation of packages , whereas Cygwin does not provide a package manager , package installation is done through the installer , each time a package is to be installed or removed .

MSYS2

Installation

To install MSYS2 , download the installer from the MSYS2 website , and double click it .

Click next , on the first screen , next for the install folder , next for the start menu shortcuts , after that msys2 will start installing .

Once the installation is done , three shortcuts will be created in the start menu .

One will launch the MSYS2 Mingw 64 terminal , another will launch the MSYS2 Mingw 32 terminal , and the last one will launch the MSYS2 MSYS terminal . The difference between these three launchers , is the path :

MINGW32# echo $PATH
/mingw32/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
#Has /mingw32/bin , prepended , and is 
#missing /opt/bin comparing to MSYS
#path . Differs from MINGW64 path , 
#by just the prepended directory . 


MINGW64# echo $PATH
/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
#Has /mingw64/bin prepended , 
#and is missing /opt/bin , 
#when comparing to MSYS .
#Only differs by the prepended 
#path , from MINGW32 .


MSYS# echo $PATH
/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

Click on finish , this will run the MSYS2 MSYS terminal .

From the opened terminal , and to install the mingw-w64 compiler , and the cygwin-gcc compiler , first issue this command :

$ pacman --sync --refresh --sysupgrade 
#Sync the packages , refreshing the 
#database , and upgrading outdated 
#packages . 
:: Synchronizing package databases...
 mingw32                         870.9 KiB   268 KiB/s 00:03 [################################] 100%
 mingw32.sig                     438.0   B  0.00   B/s 00:00 [################################] 100%
 mingw64                         874.5 KiB   290 KiB/s 00:03 [################################] 100%
 mingw64.sig                     438.0   B  0.00   B/s 00:00 [################################] 100%
 msys                            295.4 KiB   231 KiB/s 00:01 [################################] 100%
 msys.sig                        438.0   B  0.00   B/s 00:00 [################################] 100%
:: Starting core system upgrade...
 there is nothing to do
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (18) bsdtar-3.5.1-1  dash-0.5.11.3-1  gdbm-1.19-1  glib2-2.66.4-2  gnupg-2.2.27-1
              icu-68.2-1  libgdbm-1.19-1  libgpg-error-1.41-2  libgpgme-1.15.1-1  libhogweed-3.7-1
              libnettle-3.7-1  libp11-kit-0.23.22-2  libxml2-2.9.10-7  msys2-keyring-1~20210123-1
              nettle-3.7-1  p11-kit-0.23.22-2  tzcode-2020f-1  wget-1.21.1-2

Total Download Size:   18.17 MiB
Total Installed Size:  67.88 MiB
Net Upgrade Size:       1.22 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 libhogweed-3.7-1-x86_64         183.4 KiB   230 KiB/s 00:01 [################################] 100%
 libnettle-3.7-1-x86_64          129.3 KiB   237 KiB/s 00:01 [################################] 100
...
...

Next issue this command :

$ pacman -S --needed base-devel msys2-devel mingw-w64-x86_64-toolchain 
#sync the packages .
#install only the non installed
#packages from the group of
#packages base-devel , and 
#the group of packages msys2-devel 
#which contain a c/c++ posix 
#compiler , and install 
# mingw-w64-x86_64-toolchain
#for a windows c/c++ compiler .
warning: file-5.39-2 is up to date -- skipping
warning: gawk-5.1.0-1 is up to date -- skipping
warning: gettext-0.19.8.1-1 is up to date -- skipping
warning: grep-3.0-2 is up to date -- skipping
warning: pacman-5.2.2-9 is up to date -- skipping
warning: perl-5.32.0-2 is up to date -- skipping
warning: sed-4.8-1 is up to date -- skipping
warning: wget-1.21.1-2 is up to date -- skipping
:: There are 48 members in group base-devel:
:: Repository msys
   1) asciidoc  2) autoconf  3) autoconf2.13  4) autogen  5) automake-wrapper  6) automake1.10
   7) automake1.11  8) automake1.12  9) automake1.13  10) automake1.14  11) automake1.15
   12) automake1.16  13) automake1.6  14) automake1.7  15) automake1.8  16) automake1.9  17) bison
   18) btyacc  19) diffstat  20) diffutils  21) dos2unix  22) flex  23) gdb  24) gettext-devel
   25) gperf  26) groff  27) help2man  28) intltool  29) libtool  30) libunrar  31) libunrar-devel
   32) m4  33) make  34) man-db  35) pactoys-git  36) patch  37) patchutils  38) pkgconf
   39) pkgfile  40) quilt  41) reflex  42) scons  43) swig  44) texinfo  45) texinfo-tex  46) ttyrec
   47) unrar  48) xmlto

Enter a selection (default=all):
warning: gcc-libs-10.2.0-1 is up to date -- skipping
:: There are 7 members in group msys2-devel:
:: Repository msys
   1) binutils  2) cocom  3) gcc  4) gcc-fortran  5) msys2-runtime-devel  6) msys2-w32api-headers
   7) msys2-w32api-runtime

Enter a selection (default=all):
:: There are 19 members in group mingw-w64-x86_64-toolchain:
:: Repository mingw64
   1) mingw-w64-x86_64-binutils  2) mingw-w64-x86_64-crt-git  3) mingw-w64-x86_64-gcc
   4) mingw-w64-x86_64-gcc-ada  5) mingw-w64-x86_64-gcc-fortran  6) mingw-w64-x86_64-gcc-libgfortran
   7) mingw-w64-x86_64-gcc-libs  8) mingw-w64-x86_64-gcc-objc  9) mingw-w64-x86_64-gdb
   10) mingw-w64-x86_64-gdb-multiarch  11) mingw-w64-x86_64-headers-git
   12) mingw-w64-x86_64-libgccjit  13) mingw-w64-x86_64-libmangle-git
   14) mingw-w64-x86_64-libwinpthread-git  15) mingw-w64-x86_64-make  16) mingw-w64-x86_64-pkgconf
   17) mingw-w64-x86_64-tools-git  18) mingw-w64-x86_64-winpthreads-git
   19) mingw-w64-x86_64-winstorecompat-git

Enter a selection (default=all):
resolving dependencies...
looking for conflicting packages...

Packages (133) docbook-xml-4.5-2  docbook-xsl-1.79.2-1  expat-2.2.10-1  isl-0.22.1-1
               libarchive-3.5.1-1  libatomic_ops-7.6.10-1  libgc-8.0.4-1  libguile-2.2.7-1
               libiconv-devel-1.16-2  libltdl-2.4.6-9  libpcre16-8.44-1  libpcre2_16-10.36-1
               libpcre2_32-10.36-1  libpcre2posix-10.36-1  libpcre32-8.44-1  libpcrecpp-8.44-1
               libpcreposix-8.44-1  libpipeline-1.5.3-2  mingw-w64-x86_64-bzip2-1.0.8-2
               mingw-w64-x86_64-ca-certificates-20200601-2  mingw-w64-x86_64-expat-2.2.10-1
               mingw-w64-x86_64-gettext-0.19.8.1-10  mingw-w64-x86_64-gmp-6.2.1-1
               mingw-w64-x86_64-isl-0.23-1  mingw-w64-x86_64-libffi-3.3-3
               mingw-w64-x86_64-libiconv-1.16-2  mingw-w64-x86_64-libsystre-1.0.1-4
               mingw-w64-x86_64-libtasn1-4.16.0-1  mingw-w64-x86_64-libtre-git-r128.6fb7206-2
               mingw-w64-x86_64-mpc-1.2.1-1  mingw-w64-x86_64-mpdecimal-2.5.0-1
               mingw-w64-x86_64-mpfr-4.1.0-3  mingw-w64-x86_64-ncurses-6.2-2
               mingw-w64-x86_64-openssl-1.1.1.i-1  mingw-w64-x86_64-p11-kit-0.23.22-1
               mingw-w64-x86_64-python-3.8.7-3  mingw-w64-x86_64-readline-8.0.004-2
               mingw-w64-x86_64-sqlite3-3.34.1-1  mingw-w64-x86_64-tcl-8.6.11-2
               mingw-w64-x86_64-termcap-1.3.1-6  mingw-w64-x86_64-tk-8.6.11.1-1
               mingw-w64-x86_64-windows-default-manifest-6.4-3  mingw-w64-x86_64-xxhash-0.8.0-1
               mingw-w64-x86_64-xz-5.2.5-2  mingw-w64-x86_64-zlib-1.2.11-9
               mingw-w64-x86_64-zstd-1.4.8-2  mpc-1.1.0-1  mpdecimal-2.5.0-1  pcre-8.44-1
               pcre2-10.36-1  perl-Locale-Gettext-1.07-7  perl-Module-Build-0.4231-1
               perl-Test-Pod-1.52-1  perl-XML-Parser-2.46-3  perl-YAML-Syck-1.32-4
               perl-inc-latest-0.500-1  python-3.8.7-1  tar-1.33-1  windows-default-manifest-6.4-1
               asciidoc-9.0.4-1  autoconf-2.69-5  autoconf2.13-2.13-3  autogen-5.18.16-1
               automake-wrapper-11-1  automake1.10-1.10.3-4  automake1.11-1.11.6-4
               automake1.12-1.12.6-4  automake1.13-1.13.4-5  automake1.14-1.14.1-4
               automake1.15-1.15.1-2  automake1.16-1.16.2-2  automake1.6-1.6.3-3
               automake1.7-1.7.9-3  automake1.8-1.8.5-4  automake1.9-1.9.6-3  binutils-2.35.1-1
               bison-3.7.4-1  btyacc-20200910-1  cocom-0.996-2  diffstat-1.63-1  diffutils-3.7-1
               dos2unix-7.4.2-1  flex-2.6.4-1  gcc-10.2.0-1  gcc-fortran-10.2.0-1  gdb-9.2-3
               gettext-devel-0.19.8.1-1  gperf-3.1-2  groff-1.22.4-1  help2man-1.47.16-1
               intltool-0.51.0-2  libtool-2.4.6-9  libunrar-6.0.3-1  libunrar-devel-6.0.3-1
               m4-1.4.18-2  make-4.3-1  man-db-2.9.3-1  mingw-w64-x86_64-binutils-2.35.1-3
               mingw-w64-x86_64-crt-git-9.0.0.6090.ad98746a-1  mingw-w64-x86_64-gcc-10.2.0-6
               mingw-w64-x86_64-gcc-ada-10.2.0-6  mingw-w64-x86_64-gcc-fortran-10.2.0-6
               mingw-w64-x86_64-gcc-libgfortran-10.2.0-6  mingw-w64-x86_64-gcc-libs-10.2.0-6
               mingw-w64-x86_64-gcc-objc-10.2.0-6  mingw-w64-x86_64-gdb-10.1-2
               mingw-w64-x86_64-gdb-multiarch-10.1-2
               mingw-w64-x86_64-headers-git-9.0.0.6090.ad98746a-1
               mingw-w64-x86_64-libgccjit-10.2.0-6
               mingw-w64-x86_64-libmangle-git-9.0.0.6090.ad98746a-1
               mingw-w64-x86_64-libwinpthread-git-9.0.0.6090.ad98746a-1  mingw-w64-x86_64-make-4.3-1
               mingw-w64-x86_64-pkgconf-1.7.3-5  mingw-w64-x86_64-tools-git-9.0.0.6090.ad98746a-1
               mingw-w64-x86_64-winpthreads-git-9.0.0.6090.ad98746a-1
               mingw-w64-x86_64-winstorecompat-git-9.0.0.6090.ad98746a-1
               msys2-runtime-devel-3.1.7-4  msys2-w32api-headers-8.0.0.5683.629fd2b1-1
               msys2-w32api-runtime-8.0.0.5683.629fd2b1-1  pactoys-git-r2.07ca37f-1  patch-2.7.6-1
               patchutils-0.4.2-1  pkgconf-1.7.3-2  pkgfile-21-1  quilt-0.66-2  reflex-20200715-1
               scons-3.1.2-4  swig-4.0.2-1  texinfo-6.7-3  texinfo-tex-6.7-3  ttyrec-1.0.8-2
               unrar-6.0.3-1  xmlto-0.0.28-2

Total Download Size:    247.69 MiB
Total Installed Size:  1603.39 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 mingw-w64-x86_64-libiconv-...   744.5 KiB   270 KiB/s 00:03 [################################] 100%
 mingw-w64-x86_64-zlib-1.2....   101.4 KiB   186 KiB/s 00:01 [################################] 100%

The Cygwin compiler , which is able to compile posix source code , is accessible from the already open terminal , which is , the MSYS2 MSYS terminal , because it is in the path .

$ g++ --version
g++ (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


#Optionally Create a source file
#containing posix api , and 
#compile it .

$ nano test.c
#Paste the following content .

#include <termios.h>
/*Contains the definitions
  used by the terminal I/O
  interfaces .*/

#include<stdio.h>
/*Include the standard input
  and output */

int main(void ){
  printf("%d" , IGNPAR );
  /*Print the value of the constant ,
    ignore characters with parity
    errors . */ }

#control-x followed by a 
#yes , and an enter to exit 
#nano and save the source file . 

$ cc test.c
#Compile the source file .

$./a.exe
#Execute the compiled source file .
4

The MinGW 64 compiler , which produces windows executable , that do not depend on cygwin1.dll , and which cannot compile posix source code , is accessible from the terminal MSYS2 MinGW 64 , which can be gotten , by clicking on the shortcut MSYS2 MinGW 64-bit , in the start menu .

$ g++ --version
g++.exe (Rev6, Built by MSYS2 project) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Package management using pacman

Intro

pacman is the package manager used by MSYS2 , it installs the packages to a subdirectory in the MSYS2 installation directory , which is by default C:\msys64 .

pacman has three repositories configured , from which packages can be installed .

The first one is the msys2 repository , which related directories are /etc and /usr , and which installed packages , are accessible using the terminal MSYS2 MSYS . This repository contains the Cygwin compiler , which produces windows executable , dependent on the cygwin1.dll library .

An example of an application , installed from the msys2 repository , is emacs .

$ which emacs
#Path of the accessible 
#emacs .
/usr/bin/emacs

The latter two are the mingw32 , and mingw64 repositories , which related directories are : /mingw32 , and /mingw64 .

Their installed packages are accessible from MSYS2 MinGW 32-bit and MSYS2 MinGW 64-bit shortcuts .

An example of an application installed from the mingw64 repository , is emacs .

$ which emacs
#Path of the accessible 
#emacs .
/mingw64/bin/emacs

Other directories found under C:\msys64 , and related to posix are : /bin , /dev , /home , /opt , /proc , /tmp , /var . The windows disk drives , can be accessed using /c or /d or …

The pacman --sync operation is used to synchronize the packages . The packages synchronization operation , must be followed by an option , which is the option , of what this operation will be doing .

Updating packages

To update the package database , --sync --refresh , can be used , and to force a refresh of the package database , even if it is up to date , --sync --refresh --refresh can be used .

$ pacman --sync --refresh
#--sync operation is used for 
#package synchronization . Package
#synchronization take some options .
#The --refresh option is used to 
#refresh the database . 
:: Synchronizing package databases...
 mingw32               870.9 KiB   527 KiB/s 00:02 [#####################] 100%
 mingw32.sig           438.0   B  0.00   B/s 00:00 [#####################] 100%
 mingw64               874.5 KiB   496 KiB/s 00:02 [#####################] 100%
 mingw64.sig           438.0   B  0.00   B/s 00:00 [#####################] 100%
 msys                  295.4 KiB   421 KiB/s 00:01 [#####################] 100%
 msys.sig              438.0   B  0.00   B/s 00:00 [#####################] 100%

Upgrading packages

To upgrade all the packages which are out of date , --sync --sysupgrade can be used .

$ pacman --sync --refresh --sysupgrade 
#The sync operation is performed , 
#It is passed the refresh option ,
#to refresh the database , and the 
#sysupgrade option , to upgrade ,
#all of the installed packages .
:: Synchronizing package databases...
 mingw32 is up to date
 mingw64 is up to date
 msys is up to date
:: Starting core system upgrade...
 there is nothing to do
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (18) bsdtar-3.5.1-1  dash-0.5.11.3-1  gdbm-1.19-1  glib2-2.66.4-2
              gnupg-2.2.27-1  icu-68.2-1  libgdbm-1.19-1  libgpg-error-1.41-2
              libgpgme-1.15.1-1  libhogweed-3.7-1  libnettle-3.7-1
              libp11-kit-0.23.22-2  libxml2-2.9.10-7
              msys2-keyring-1~20210123-1  nettle-3.7-1  p11-kit-0.23.22-2
              tzcode-2020f-1  wget-1.21.1-2

Total Download Size:   18.17 MiB
Total Installed Size:  67.88 MiB
Net Upgrade Size:       1.22 MiB

:: Proceed with installation? [Y/n]
:: Retrieving packages...
 libhogweed-3.7-1...   183.4 KiB   294 KiB/s 00:01 [#####################] 100%
...
...

Searching , and getting packages information

To search for a package , one of these following options can be used .

--sync --groups , will list all the available groups . A group is a set of related packages , that can be installed together . An optional group name can be provided , in this case , the packages , that belong to this group , are displayed .

$ pacman --sync --groups
#--sync operation is used to 
#sync the packages . It takes
#options , the --groups option
#will list all the available
#groups of packages .
mingw-w64-i686-arm-none-eabi-toolchain
kf5
mingw-w64-i686-avr-toolchain
mingw-w64-i686-toolchain
mingw-w64-i686-eda
mingw-w64-i686
mingw-w64-i686-gimp-plugins
kde-applications
kdebase
mingw-w64-i686-qt
mingw-w64-i686-qt5
mingw-w64-i686-qt-static
mingw-w64-i686-qt5-static
mingw-w64-i686-riscv64-unknown-elf-toolchain
mingw-w64-i686-vulkan-devel
tesseract-data
mingw-w64-x86_64-arm-none-eabi-toolchain
mingw-w64-x86_64-avr-toolchain
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-eda
mingw-w64-x86_64
mingw-w64-x86_64-gimp-plugins
mingw-w64-x86_64-qt
mingw-w64-x86_64-qt5
mingw-w64-x86_64-qt-static
mingw-w64-x86_64-qt5-static
mingw-w64-x86_64-riscv64-unknown-elf-toolchain
mingw-w64-x86_64-vulkan-devel
libraries
development
base-devel
msys2-devel
VCS
base
compression
sys-utils
Database
vim-plugins
net-utils
editors
python-modules
midipix-cross-toolchain
midipix-cross
mingw-w64-cross-toolchain
mingw-w64-cross
mingw-w64-cross-clang-toolchain
perl-modules
utilities


$ pacman --sync --groups --groups base
#View all the packages related 
#to the group base . 
base bzip2
base coreutils
base findutils
base flex
base gawk
base getent
base grep
base gzip
base inetutils
base libargp
base lndir
base msys2-launcher
base ncurses
base pactoys-git
base pkgfile
base sed
base tftp-hpa
base time
base ttyrec
base which

To list all the available packages --sync --list can be used . Optionally the name of a repository can be specified , to list only packages from that repository .

$ pacman --sync --list msys
#List only the packages that 
#are available from the msys
#repository . 
msys ansible 2.9.11-1
msys apr 1.7.0-1
msys apr-devel 1.7.0-1
msys apr-util 1.6.1-1
msys apr-util-devel 1.6.1-1
msys asciidoc 9.0.4-1
msys aspell 0.60.8-1
msys aspell-devel 0.60.8-1
msys aspell6-en 2019.10.06-1
msys atool 0.39.0-1
msys autoconf 2.69-5
msys autoconf-archive 2019.01.06-1
msys autoconf2.13 2.13-3
msys autogen 5.18.16-1
msys automake-wrapper 11-1
msys automake1.10 1.10.3-4
msys automake1.11 1.11.6-4
msys automake1.12 1.12.6-4
msys automake1.13 1.13.4-5
msys automake1.14 1.14.1-4
msys automake1.15 1.15.1-2
msys automake1.16 1.16.2-2
msys automake1.6 1.6.3-3
msys automake1.7 1.7.9-3
msys automake1.8 1.8.5-4
....
....

To search for a specific package using regex . --sync --search theRegex can be used .

$ pacman --sync --search 'emac.*'
#Search for all the packages , 
#that contain emac , and end 
#with zero or more character .
mingw32/mingw-w64-i686-emacs 27.1-2
    The extensible, customizable, self-documenting, real-time display editor (mingw-w64)
mingw32/mingw-w64-i686-liberime 0.0.5-2
    An emacs dynamic module provide librime bindings for emacs (mingw-w64)
mingw64/mingw-w64-x86_64-emacs 27.1-2
    The extensible, customizable, self-documenting, real-time display editor (mingw-w64)
mingw64/mingw-w64-x86_64-liberime 0.0.5-2
    An emacs dynamic module provide librime bindings for emacs (mingw-w64)
msys/cmake-emacs 3.19.3-1
    A cross-platform open-source make system (Emacs mode)
msys/emacs 27.1-2 (editors)
    The extensible, customizable, self-documenting, real-time display editor (msys2)
msys/ninja-emacs 1.10.2-1
    Ninja is a small build system with a focus on speed (Emacs mode)

To view all packages information , --sync --info can be used . It takes an optional package name , in this case only information related to this package is shown .

$ pacman --sync --info emacs 
#View information related to 
#the emacs package .
Repository      : msys
Name            : emacs
Version         : 27.1-2
Description     : The extensible, customizable, self-documenting, real-time display editor (msys2)
Architecture    : x86_64
URL             : https://www.gnu.org/software/emacs/
Licenses        : GPL3
Groups          : editors
Provides        : None
Depends On      : ncurses  zlib  libxml2  libiconv  libcrypt  libgnutls  glib2  libhogweed
Optional Deps   : None
Conflicts With  : None
Replaces        : None
Download Size   : 32.58 MiB
Installed Size  : 163.28 MiB
Packager        : CI (msys2-autobuild/6e7d6a99/328625740)
Build Date      : Mon Oct 26 02:56:47 2020
Validated By    : MD5 Sum  SHA-256 Sum  Signature

Finally packages details , can be viewed on the msys2 package website .

Installing packages

A package can be installed by specifying the package name after --sync . Multiple packages , can be installed , at the same time . A group name can also be specified , to install all packages contained in this group . A group is a set of related packages .

$ pacman --sync vim
#Install the vim editor 
resolving dependencies...
looking for conflicting packages...

Packages (1) vim-8.2.1895-1

Total Download Size:    7.78 MiB
Total Installed Size:  47.67 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 vim-8.2.1895-1-x...     2.5 MiB   573 KiB/s 00:09 [######---------------]  ....


$ pacman --sync editors
#Install all the editors , found ,
#in the editors group . They
#are emacs , nano , and vim .
:: There are 3 members in group editors:
:: Repository msys
   1) emacs  2) nano  3) vim

Enter a selection (default=all):
...

Uninstalling packages

To uninstall a package , or a group of packages , where a group is a set of packages , --remove can be used .

$ pacman --remove vim
#Remove the vim editor .
checking dependencies...
:: pacman-contrib optionally requires vim

Packages (1) vim-8.2.1895-1

Total Removed Size:  47.67 MiB

:: Do you want to remove these packages? [Y/n] y
:: Processing package changes...
(1/1) removing vim                                 [#####################] 100%

Cygwin

Cygwin is a collection of open source software , such as vim , or sed , which uses the posix api , and which is compiled to run under windows . So this is just a collection of windows executables , or windows programs . The posix api is provided by Cygwin , via the cygwin1.dll library .

The Cygwin installer , can be downloaded from the official website , and it can be used to install , or uninstall windows applications .

Once the package is downloaded , just double click it , this will run it . On the first screen select next , choose install from the internet , click next for the root install directory , and next for the local package directory , and next for the internet connection settings , select any download site , and click next .

In the search box , type in gcc , and then expand the package selection under Devel , and choose gcc-core and gcc-g++ , if you want to install the Cygwin C , and C++ compilers , which have support for the posix and windows api , or mingw64-x86_64-gcc-core , and mingw64-x86_64-gcc-g++ , to install the mingw64 C , and C++ compilers , which only support the windows api .

After that search for gdb which is used for debugging , and select it .

Next search for make , which is used to automate the compilation process , and select it .

Choose any additional packages , that you might like , for example emacs , or nano , they are both found under editors . Once , you are done selecting the packages , click next , followed by a next on the review and confirm the changes screen , and wait for the installation to finish .

Finally click on finish when prompted to create desktop , and start menu icons .

Once done , you will have a desktop icon named Cygwin64 Terminal . Just double click it to launch the terminal .

The windows drives are accessible from cygdrive/c or cygdrive/d …To get information about a package , clicking a package , in the package list page , will show its information . Package contents can be searched using , the Cygwin package search page .