"Package was not found in the pkg-config search path"。但实际上有

"Package was not found in the pkg-config search path". But actually is there

我正在使用 MinSYS2 并且我已经安装了这个包:https://packages.msys2.org/package/mingw-w64-i686-gimp?repo=mingw32

pacman -S mingw32/mingw-w64-i686-gimp

现在如果我 运行 gimptool-2.0 --cflags --libs 它 returns:

Package gimpui-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gimpui-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gimpui-2.0' found
No output from 'pkg-config --cflags gimpui-2.0'

奇怪的是 gimpui-2.0.pc 实际上在系统中,在文件夹 \mingw32\lib\pkgconfig 中。此文件夹正确地是 PKG_CONFIG_PATH 变量的一部分:

$ echo $PKG_CONFIG_PATH
/mingw32/lib/pkgconfig:/mingw32/share/pkgconfig

gimpui-2的内容0.pc:

prefix=/mingw32
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: GIMP UI
Description: GIMP User Interface Library
Version: 2.10.10
Requires: gimp-2.0 >= 2.10 gtk+-2.0 >= 2.24.32
Libs: -L${libdir} -lgimpui-2.0 -lgimpwidgets-2.0 -lgimpmodule-2.0
Cflags: -I${includedir}/gimp-2.0

如何解决?

我已经通过安装工具链解决了:https://packages.msys2.org/group/mingw-w64-i686-toolchain