FFMpeg Cygwin 编译

FFMpeg Cygwin Compilation

我正在尝试使用以下内容编译 ffmpeg:

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

但是,我得到了对 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

然而,我的 libavdevice.pc 显示:

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}

注意 libs 行被 nano 截断,但包括 -luuid。有什么想法吗?

在下面添加了一个 ff_GUID_NULL 定义,它可以正常编译和运行。

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);

我遇到了同样的问题。是的,GUID_NULL已经在cguid.h中定义了,所以定义一个新的GUID_NULL_N DEFINE_GUID(GUID_NULL_N, 0x00000000,0x0000,0x0000,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00) 在 libavdevice/dshow_enummediatypes.c 中替换 GUID_NULL.