如何在MSYS2上安装libpng?

时间:2019-06-15 18:19:33

标签: msys2 pacman-package-manager

我想用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

我尝试使用google并想到了:

$ 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上进行了调整的另一个软件包?

1 个答案:

答案 0 :(得分:1)

您尝试过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