c++ - mingw-64 - 安装包

标签 c++ c cmake mingw mingw-w64

我在 Windows 10 中使用 mingw_64CLion 来尝试在一个简单的项目中使用库 ( 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_64CLion 中安装这些先决条件?

最佳答案

如果您通过 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/

相关文章:

c++ - boost::factory 和 std::function

c - FreeRTOS 应用程序堆栈可用内存随着时间的推移而减少

c - C的xUnit测试框架

cmake - CMake 中的可移植整体文件链接

c++ - 如何修改 CMakelists for Qt5 从 Windows 到 Linux?

c++ - 拖放 Win API 32

c++ - Windows API - 设置了 OPEN_EXISTING 的 CreateFile() 返回错误代码 ERROR_ALREADY_EXISTS (183)

c++ - VS代码包含路径

c - 使用 malloc 为数组分配内存

CMake、GNU 和 STM32 : _exit Link Error when Testing Compiler