Search code examples
cffmpegld

FFMpeg Cygwin Compilation


I'm trying to compile ffmpeg with the following:

./configure --disable-stripping --enable-debug=3 --extra-cflags="-g" --disable-optimizations

However, I'm getting an undefined reference to GUID_NULL:

$ make
LD      ffmpeg_g.exe
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: libavdevice/libavdevice.a(dshow_enummediatypes.o):dshow_enummediatypes.c (.rdata$.refptr.GUID_NULL[.refptr.GUID_NULL]+0x0): undefined reference to `GUID_NULL'
collect2: error: ld returned 1 exit status
make: *** [Makefile:114: ffmpeg_g.exe] Error 1

However, my libavdevice.pc reads:

prefix=/usr/local
exec_prefix=${prefix}
libdir=/usr/local/lib
includedir=/usr/local/include

Name: libavdevice
Description: FFmpeg device handling library
Version: 58.11.101
Requires: libavfilter >= 7.87.100, libswscale >= 5.8.100, libavformat >= 58.48.100, libavcodec >= 58.96.100, >Requires.private:
Conflicts:
Libs: -L${libdir}  -lavdevice -lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi -lgdi32 -lm -lvfw32 -lxc>Libs.private:
Cflags: -I${includedir}

Note the libs line is cut off by nano, but includes -luuid. Any ideas?


Solution

  • Added an ff_GUID_NULL define to the following and it compiles and runs fine.

    libavdevice/dshow_enummediatypes.c:

    #include "dshow_capture.h"
    
    DECLARE_QUERYINTERFACE(libAVEnumMediaTypes,
        { {&IID_IUnknown,0}, {&IID_IEnumMediaTypes,0} })
    DECLARE_ADDREF(libAVEnumMediaTypes)
    DECLARE_RELEASE(libAVEnumMediaTypes)
    DEFINE_GUID(ff_GUID_NULL, 0x00000000,0x0000,0x0000,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);