1

我想用 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 上调整的那样?

4

1 回答 1

2

你试过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
于 2019-06-15T18:31:32.140 回答