我是一名真正的初学者,所以提前就明显的问题道歉。我正在尝试编译ffmpeg的自定义构建,它具有正常构建所没有的额外依赖性。其中包括libgcrypt
和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错误的repo,运行make
和make install
,在libgpg-error.dll.a
中创建了libgpg-error.la
和/home/myuser/w64root/lib
。我已经尝试将此路径添加到我的$LIB
环境变量中,但是配置运行仍然说它无法找到库。
如何让它可见?我也在机器上有pkg-config
- 手动创建.pc
文件可以帮助我吗?
谢谢!
答案 0 :(得分: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
你应该没事。