I was originally getting an error that someone on the Doom9 forums suggested might be due to mixing MinGW-64 and Cygwin dependencies. I then compiled or sourced MinGW-64 versions of all of the required dependencies (as some dependencies could not be compiled with Cygwin alone), and FFmpeg still fails to configure, with the same error.
This error is always a variation of "package not found using pkg-config" - if libaom is enabled, I get:
ERROR: aom >= 1.0.0 not found using pkg-config
If I don't add --enable-libaom in the configure script, I get:
ERROR: libass not found using pkg-config
I'm running the following on the command line, in a single shell, to compile FFmpeg:
A similar question here indicates that this is an issue with PKG_CONFIG_PATH not seeing the packages in /usr/local/lib/pkgconfig, but when I do:
Code: Select all
cd /ffmpeg_sources/ffmpeg && export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" && ./configure --arch=x86_64 --cross-prefix=x86_64-w64-mingw32- --target-os=mingw32 \ --prefix="/usr/local" \ --extra-cflags="-I/usr/local/include -static" \ --extra-ldflags="-L/usr/local/lib -static" \ --pkg-config-flags="--static" \ --extra-libs="-pthread -lm" \ --enable-libaom \ --enable-libass \ --enable-libfdk-aac \ --enable-libfreetype \ --enable-libmp3lame \ --enable-libopus \ --enable-libvorbis \ --enable-libvpx \ --enable-libx264 \ --enable-libx265 \ --enable-gpl \ --enable-nonfree \ --enable-static \ --disable-shared && make -j$(nproc) && make install
...it returns a 0, indicating aom.pc was found in the PKG_CONFIG_PATH - which either rules out an issue with PKG_CONFIG_PATH or makes it a very specific one in which only configure and make aren't able to see PKG_CONFIG_PATH, despite being run from the same shell just a moment after.
Code: Select all
cd /ffmpeg_sources/ffmpeg && PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" && pkg-config --exists --print-errors aom && echo $?
How can I resolve this?
I did some further investigation by looking into ffbuild/config.log, and noticed that it shows a warning:
WARNING: x86_64-w64-mingw32-pkg-config not found, library detection may fail.
However, doing apt-cyg search x86_64-w64-mingw32-pkg-config shows that particular package as being installed.
Sure enough, in the /bin folder, there is an extensionless file called x86_64-w64-mingw32-pkg-config, with the following contents:
https://ffmpeg.org/pipermail/ffmpeg-dev ... 26683.html
Warning "i686-mingw32-pkg-config not found, library detection may fail" while cross compiling ffmpeg