2

我想为 Windows 交叉编译 glib。配置抛出此错误:

配置:警告:使用不以主机三元组为前缀的交叉工具配置:错误:未满足包要求(libffi >= 3.0.0):

找不到包“libffi”

如果您以非标准前缀安装软件,请考虑调整 PKG_CONFIG_PATH 环境变量。

或者,您可以设置环境变量 LIBFFI_CFLAGS 和 LIBFFI_LIBS 以避免调用 pkg-config。有关更多详细信息,请参见 pkg-config 手册页。

但是pkg-config --modversion libffi打印“3.1”。我已经从 debian jessie 存储库安装了 libffi 和 libffi-dev。

(我不确定这是否属于超级用户,因为它也与包问题有关)

4

2 回答 2

2

查看使用 MinGW 引导 GLIB的步骤


1.本质上需要先下载源码,编译安装libffi

cd /path/to/libffi/source
mkdir bld
cd bld
../configure --prefix=/mingw
make && make install

2. ...接着建造glib没有PKG_CONFIG

cd /path/to/glib/source
mkdir bld
cd bld
export LIBFFI_CFLAGS='-I /mingw/lib/libffi-VERSION/include'
    VERSION is to be replaced with whatever version you built above.
    For me VERSION is 3.0.10.
export LIBFFI_LIBS=-lffi
export lt_cv_deplibs_check_method="pass_all"
export CFLAGS=”O0 -g -pipe -Wall -march=i486 -mms-bitfields -mthreads”
export CPPFLAGS=”-DG_ATOMIC_OP_USE_GCC_BUILTINS=1”
export LDFLAGS=”-Wl,--enable-auto-image-base”
../configure --prefix=/mingw --with-pcre=internal --disable-static --disable-gtk-doc --enable-silent-rules
make
make install

3. 随后,pkg_config可以构建和安装。

4.然后glib可以正常重建如下:

cd /path/to/glib/source/bld
make clean
../configure --prefix=/mingw
make
make install
于 2016-12-24T16:58:23.293 回答
0

就我而言,我在运行 npm i 时收到了下一条错误消息:

node-gyp rebuild

Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libffi', required by 'gobject-2.0', not found
gyp: Call to 'pkg-config --cflags  cairo poppler-qt5' returned exit status 1 while in binding.gyp. while trying to load binding.gyp

我发现问题出在导出 PATH

所以我跑了brew reinstall -s poppler

在安装结束时,您可以运行路径的导出

If you need to have qt first in your PATH run:
  echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.zshrc

For compilers to find qt you may need to set:
  export LDFLAGS="-L/usr/local/opt/qt/lib"
  export CPPFLAGS="-I/usr/local/opt/qt/include"

For pkg-config to find qt you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig"

这为我修好了。

我希望你觉得它有帮助。

于 2019-03-19T21:23:42.777 回答