我在 Windows 10
中使用 mingw_64
和 CLion
来尝试在一个简单的项目中使用库 ( https://github.com/libtrading/libtrading),但是该库需要在使用之前安装一些包。问题是安装说明适用于 Linux 环境,如下所示:
# 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
那么,如何在 Windows 10
环境中的 mingw_64
和 CLion
中安装这些先决条件?
最佳答案
如果您通过 MSYS2 安装了 MinGW,则可以使用 MSYS2 pacman
package manager安装额外的包:
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>
例子:
$ 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%
pacman
的较短版本是pacboy
.例如,您可以指定 :x
安装 mingw64 包的后缀:
$ pacboy -S libxml2:x
关于c++ - mingw-64 - 安装包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45618405/