0

我是一个真正的初学者,所以提前为明显的问题道歉。我正在尝试编译 ffmpeg 的自定义构建,它具有一些普通构建没有的额外依赖项。其中是libgcryptand libgpg-error- 我知道这一点,因为当我运行时configure,它失败了,并且日志包含:

C:/workspace/windows/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcrypt
C:/workspace/windows/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgpg-error

考虑到这一点,我克隆了 libgpg-error 的 repo,运行了makeand make install,它创建了libgpg-error.dll.aand libgpg-error.lain /home/myuser/w64root/lib。我已经尝试将此路径添加到我的$LIB环境变量中,但配置运行仍然说它找不到库。

我怎样才能让它可见?我也pkg-config可以在机器上使用 - 手动创建.pc文件对我有帮助吗?

谢谢!

4

1 回答 1

0

如果你运行./configure -h,你应该在输出中看到:

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags

特别注意LDFLAGS。这涵盖了您的情况,因为/home/myuser/w64root/lib 它不在链接器的标准搜索目录中。因此运行:

export LDFLAGS='-L/home/myuser/w64root/lib'; ./configure

你应该没事。

于 2016-11-28T19:22:05.077 回答