如何在 MSYS2 上安装 libpng?

问题描述 投票:0回答:2

我想用 mingw w64 构建一个程序,并且我安装了 msys2。

我尝试在 msys2 提示符下使用 pacman。

$ pacman -Q libpng
error: package 'libpng' was not found
$ pacman -S libpng
error: target not found: libpng
$ pacman -S *libpng
error: target not found: *libpng

我尝试使用谷歌并想出了:

$ pacman -S mingw-w64-libpng
error: target not found: mingw-w64-libpng
$ pacman -F mingw-w64-libpng
warning: database file for 'mingw32' does not exist (use '-Fy' to download)
warning: database file for 'mingw64' does not exist (use '-Fy' to download)
warning: database file for 'msys' does not exist (use '-Fy' to download)
error: no options specified (use -h for help)

非常奇怪的是,在我下载完所有内容后(我清楚地记得其中包括 pacman 的数据库),这些数据库文件似乎不存在。

$ pacman -Fy mingw-w64-libpng
[... stuff downloads ... ]
error: no options specified (use -h for help)
$ pacman -U mingw-w64-libpng
loading packages...
error: 'mingw-w64-libpng': could not find or read package

所以现在的问题是,

1)将来我如何找到知名库的魔法前缀,以便能够告诉 pacman 要安装什么?

2) 目前我如何指示 pacman 安装似乎位于 mingw-w64-libpng 包中的 libpng 包?

3)这是带有开发头文件的包还是另一个包,因为我已经通过寻找类似 libpng-dev 的东西在 Deb/Ubuntu 上进行了调整?

msys2 pacman-package-manager
2个回答
4
投票

你试过

pacman -Ss libpng
吗?这将列出所有提到 libpng、前缀和所有的包:

$ pacman -Ss libpng
mingw32/mingw-w64-i686-libpng 1.6.35-1
    A collection of routines used to create PNG format graphics (mingw-w64)
mingw64/mingw-w64-x86_64-libpng 1.6.35-1 [installed]
    A collection of routines used to create PNG format graphics (mingw-w64)

我注意到这些名称包含一个架构(i686/x86_64),这在 MinGW 包名称中相当常见。

编辑:标题结束于此处:

$ ls /mingw64/include/libpng16/
png.h  pngconf.h  pnglibconf.h

0
投票

我也遇到了同样的问题。我刚刚了解到这个项目并想尝试一下。我试图下载并安装 The Silver Searcherag,这是与 grep/ack 类似的命令。我试图使用存储库中的包名称进行安装。

pacman -S mingw-w64-ag

也尝试过,

 pacman -Ss mingw-w64-ag

解决方案:我们需要二进制文件名。我们可以单击存储库名称并找到其中提到的二进制文件名。我们可以使用二进制文件名来安装任何软件包。SS for file names.

© www.soinside.com 2019 - 2024. All rights reserved.