0

I'm a real beginner at this, so apologies in advance for obvious questions. I'm trying to compile a custom build of ffmpeg that has some extra dependencies the normal build does not. Among those is libgcrypt and libgpg-error - I know this, because when I run configure, it fails, and the log contains:

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

With this in mind, I cloned the repo for libgpg-error, ran make and make install, which created libgpg-error.dll.a and libgpg-error.la in /home/myuser/w64root/lib. I've tried adding this path to my $LIB environment variable, but the configure run still says it can't find the library.

How can I make it visible? I also have pkg-config available on the machine - would manually creating a .pc file help me any?

Thanks!

Mike Kinghan
  • 55,740
  • 12
  • 153
  • 182
Alastair
  • 5,894
  • 7
  • 34
  • 61

1 Answers1

0

If you run ./configure -h, you should see this in the output:

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

Note LDFLAGS in particular. That covers your case, since /home/myuser/w64root/lib is not among the linker's standard search directories. Therefore run:

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

and you should be OK.

Mike Kinghan
  • 55,740
  • 12
  • 153
  • 182