Build errors on Debian Sid ("use of undeclared identifier 'av_register_all' and more)
Hi,
I'm getting the following build errors on Linux / Debian Sid:
$ make
[...]
/home/linus/dev-priv/ANMP/src/InputLibraryWrapper/FFMpegWrapper.cpp:52:5: error: use of undeclared identifier 'av_register_all' [clang-diagnostic-error]
52 | av_register_all();
| ^
/home/linus/dev-priv/ANMP/src/InputLibraryWrapper/FFMpegWrapper.cpp:89:14: error: cannot initialize a variable of type 'AVCodec *' with an rvalue of type 'const AVCodec *' [clang-diagnostic-error]
89 | AVCodec *decoder = avcodec_find_decoder(pCodecPar->codec_id);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/linus/dev-priv/ANMP/src/InputLibraryWrapper/FFMpegWrapper.cpp:121:48: error: no member named 'channels' in 'AVCodecParameters' [clang-diagnostic-error]
121 | this->Format.VoiceChannels[0] = pCodecPar->channels;
| ~~~~~~~~~ ^
[...]
Full log output from cmake and make:
https://gist.github.com/T-X/0d260dc61c1126a2ae3d69f8c25b0e47
It seems like av_register_all() for instance was deprecated in ffmpeg:
https://github.com/FFmpeg/FFmpeg/blob/70d25268c21cbee5f08304da95be1f647c630c15/doc/APIchanges#L86
Some library versions:
$ dpkg -l | grep libavcodec
ii libavcodec-dev:amd64 7:7.1.1-1+b1 amd64 FFmpeg library with de/encoders for audio/video codecs - development files
ii libavcodec61:amd64 7:7.1.1-1+b1 amd64 FFmpeg library with de/encoders for audio/video codecs - runtime files
$ dpkg -l | grep ffmpeg
ii ffmpeg 7:7.1.1-1+b1 amd64 Tools for transcoding, streaming and playing of multimedia files
ii gstreamer1.0-libav:amd64 1.26.2-1 amd64 ffmpeg plugin for GStreamer
$ dpkg -l | grep clang
ii clang 1:19.0-63 amd64 C, C++ and Objective-C compiler (LLVM based), clang binary
ii clang-19 1:19.1.7-3 amd64 C, C++ and Objective-C compiler
ii clang-tidy 1:19.0-63 amd64 clang-based C++ linter tool
ii clang-tidy-19 1:19.1.7-3 amd64 clang-based C++ linter tool
ii clang-tools-19 1:19.1.7-3 amd64 clang-based tools for C/C++ developments
ii libclang-common-19-dev:amd64 1:19.1.7-3 amd64 Clang library - Common development package
ii libclang-cpp19 1:19.1.7-3 amd64 C++ interface to the Clang library
ii libclang-rt-19-dev:amd64 1:19.1.7-3 amd64 Compiler-rt - development package
ii libclang1-19 1:19.1.7-3 amd64 C interface to the Clang library
Frmpeg breaks its api quite often. I wont have time to address this for the next months. You can either downgrade to ffmpeg 4 or disable ffmpeg by passing ENABLE_FFMPEG=0 to cmake.
Message ID: @.***>
Thanks a lot, using "cmake -DENABLE_FFMPEG=0 .." as a workaround worked and I can play N64 midi/dls files through ANMP now!