mpv-player / mpv-build

🔨 Helper scripts to compile mpv on Linux
http://mpv.io
403 stars 104 forks source link

Trying to build an old fork on a new server and I'm getting "error: implicit declaration of function ‘avfilter_pad_count’" #227

Closed twilson90 closed 7 months ago

twilson90 commented 7 months ago

Got an old fork from around 2021 that I'm trying to build on a new machine. The old machine was running Ubuntu 20.04.6 LTS and it built without issue. New machine is on Ubuntu 22.04.3 LTS and I get this error while building my fork of mpv:

[140/207] Compiling sub/lavc_conv.c
13:09:41 runner ['/usr/bin/cc', '-D_ISOC99_SOURCE', '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-Wall', '-std=c11', '-O2', '-g', '-Werror=implicit-function-declaration', '-Wno-error=deprecated-declarations', '-Wno-error=unused-function', '-Wempty-body', '-Wdisabled-optimization', '-Wstrict-prototypes', '-Wno-format-zero-length', '-Werror=format-security', '-Wno-redundant-decls', '-Wvla', '-Wno-format-truncation', '-Wimplicit-fallthrough', '-fno-math-errno', '-Wall', '-Wundef', '-Wmissing-prototypes', '-Wshadow', '-Wno-switch', '-Wparentheses', '-Wpointer-arith', '-Wno-pointer-sign', '-Wno-unused-result', '-pthread', '-pthread', '-pthread', '-pthread', '-pthread', '-pthread', '-pthread', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/uchardet', '-I../../build_libs/include', '-I/usr/include/luajit-2.1', '-I/usr/include/uuid', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/fribidi', '-I/usr/include/freetype2', '-I/usr/include/libpng16', '-I/usr/include/libxml2', '-D_REENTRANT', '../sub/lavc_conv.c', '-c', '-o/opt/mpv-build/mpv/build/sub/lavc_conv.c.21.o']
../filters/f_lavfi.c: In function ‘init_pads’:
../filters/f_lavfi.c:473:13: warning: ‘channel_layout’ is deprecated [-Wdeprecated-declarations]
  473 |             params->channel_layout = mp_chmap_to_lavc(&chmap);
      |             ^~~~~~
In file included from ../filters/f_lavfi.c:34:
../../build_libs/include/libavfilter/buffersrc.h:119:14: note: declared here
  119 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
../filters/f_lavfi.c: In function ‘is_single_media_only’:
../filters/f_lavfi.c:949:17: error: implicit declaration of function ‘avfilter_pad_count’ [-Werror=implicit-function-declaration]
  949 |     int count = avfilter_pad_count(pads);
      |                 ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

Waf: Leaving directory `/opt/mpv-build/mpv/build'
Build failed
 -> task in 'objects' failed with exit status 1:
        {task 140478093839376: c f_lavfi.c -> f_lavfi.c.21.o}
['/usr/bin/cc', '-D_ISOC99_SOURCE', '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-Wall', '-std=c11', '-O2', '-g', '-Werror=implicit-function-declaration', '-Wno-error=deprecated-declarations', '-Wno-error=unused-function', '-Wempty-body', '-Wdisabled-optimization', '-Wstrict-prototypes', '-Wno-format-zero-length', '-Werror=format-security', '-Wno-redundant-decls', '-Wvla', '-Wno-format-truncation', '-Wimplicit-fallthrough', '-fno-math-errno', '-Wall', '-Wundef', '-Wmissing-prototypes', '-Wshadow', '-Wno-switch', '-Wparentheses', '-Wpointer-arith', '-Wno-pointer-sign', '-Wno-unused-result', '-pthread', '-pthread', '-pthread', '-pthread', '-pthread', '-pthread', '-pthread', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/uchardet', '-I../../build_libs/include', '-I/usr/include/luajit-2.1', '-I/usr/include/uuid', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/fribidi', '-I/usr/include/freetype2', '-I/usr/include/libpng16', '-I/usr/include/libxml2', '-D_REENTRANT', '../filters/f_lavfi.c', '-c', '-o/opt/mpv-build/mpv/build/filters/f_lavfi.c.21.o']

Is there a simple fix?

llyyr commented 7 months ago

https://github.com/mpv-player/mpv/blob/68f1057d2ef3c24bf2d0dcd37d877e21e2879a65/filters/f_lavfi.c#L983-L989

You need to either build from master, or use an older ffmepg or fix errors as you discover them.

twilson90 commented 7 months ago

Gotcha. Thanks!