我想用 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 上进行了调整?
你试过
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