mingw-64 - Install package

18,139

Solution 1

If you installed MinGW through MSYS2, you can use the MSYS2 pacman package manager to install additional packages:

The MSYS2 software distribution uses a port of pacman from Arch Linux to manage (install, remove and update) binary packages and also to build those packages in the first place.

Finding package

pacman -Ss <name or part of the name of the package>

Installing a package

pacman -S <name of the package>

Example:

$ pacman -Ss libxml2
mingw64/mingw-w64-x86_64-libxml2 2.9.8-1
    XML parsing library, version 2 (mingw-w64)
. . .
$ pacman -S mingw64/mingw-w64-x86_64-libxml2
resolving dependencies...
looking for conflicting packages...

Total Download Size:    1.37 MiB
Total Installed Size:  11.06 MiB

:: Proceed with installation? [Y/n]
:: Retrieving packages...
:: Processing package changes...
(1/1) installing mingw-w64-x86_64-libxml2           [##################################] 100%

A shorter version of pacman is pacboy. For example, you can specify the :x suffix to install a mingw64 package:

$ pacboy -S libxml2:x

Solution 2

MinGW does not have any package management, so installing dependencies usually means building them yourself from source. For those self-built packages I have a Unix-like directory structure (with the usual bin, lib, include, etc. directories) apart from the MinGW installation.

Before I expand on that, please check if libTrading supports Windows at all. A quick glance over the libTrading GitHub shows no mention of Windows anywhere. That may mean that the project does not support Windows at all. But then we’re no more talking about configuring a build environment, but adding support for a whole new operating sytem to that project.

Solution 3

Here is the way I used

$ cat /usr/bin/install
# How to use
# install rsync

cd /

echo $1
# echo $2

URL=http://repo.msys2.org/msys/x86_64
FILE=`wget -O - -o /dev/null $URL | sed -n 's/.*href="\([^"]*\).*/\1/p' | grep -E ^$1 | egrep -v '.sig$' | sort | tail -1f`

echo $FILE

# wget -qO- $URL/$FILE | tar -I zstd -xvf - -C /
# wget -qO- $URL/$FILE | tar xJvf - -C /

if [[ $FILE == *.zst ]] # * is used for pattern matching
then
  wget -qO- $URL/$FILE | tar -I zstd -xvf - -C /
elif [[ $FILE == *.xz ]]
then
  wget -qO- $URL/$FILE | tar xJvf - -C /
else
  echo "$FILE is not extracted"
fi


$ install whois
whois

whois-5.5.9-1-x86_64.pkg.tar.zst
.BUILDINFO
.MTREE
.PKGINFO
etc/
etc/whois.conf
usr/
usr/bin/
usr/bin/whois.exe
usr/share/
usr/share/man/
usr/share/man/man1/
usr/share/man/man1/whois.1.gz
usr/share/man/man5/
usr/share/man/man5/whois.conf.5.gz
Share:
18,139
Joe Almore
Author by

Joe Almore

Updated on June 16, 2022

Comments

  • Joe Almore
    Joe Almore almost 2 years

    I am using mingw_64 and CLion in Windows 10 to try to use a library (https://github.com/libtrading/libtrading) in a simple project, but the library requires some packages to be installed prior the use of the library. The thing is that the installing instructions are for Linux environment as follows:

    # Debian
    $ apt-get install pkg-config libxml2-dev libglib2.0-dev libncurses5-dev \
        python-yaml libevent-dev
    
    # Fedora
    $ yum install zlib-devel libxml2-devel glib2-devel vim-common ncurses-devel \
        python-yaml libevent-devel
    
    # OSX
    $ brew install libevent glib pkgconfig
    $ pip install pyyaml
    

    So, how do I install these pre-requisites in my mingw_64 and CLion in Windows 10 environment?