loudgain icon indicating copy to clipboard operation
loudgain copied to clipboard

Build fails because of missing ”av_register_all" function

Open mundschenk-at opened this issue 3 years ago • 4 comments

Apparently the previously deprecated symbol av_register_all has been removed upstream, so the build now fails:

/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -std=gnu++11 -D_GNU_SOURCE -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/loudgain.dir/src/loudgain.c.o CMakeFiles/loudgain.dir/src/printf.c.o CMakeFiles/loudgain.dir/src/scan.c.o CMakeFiles/loudgain.dir/src/tag.cc.o -o loudgain  /usr/local/lib/libebur128.dylib -lavcodec -lavformat -lswresample -lavutil -ltag -lz 
Undefined symbols for architecture x86_64:
  "_av_register_all", referenced from:
      _scan_init in scan.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [loudgain] Error 1
make[1]: *** [CMakeFiles/loudgain.dir/all] Error 2
make: *** [all] Error 2

mundschenk-at avatar Feb 03 '22 23:02 mundschenk-at

The libavformat function av_register_all was removed in ffmpeg 5.0.

The patch in PR https://github.com/Moonbase59/loudgain/pull/50 will help.

You can also just remove the following lines from src/scan.c since you're linking against libraries provided by ffmpeg 5.0.

   if (avformat_version() < AV_VERSION_INT(58,9,100))
     av_register_all();

hughmcmaster avatar Feb 13 '22 10:02 hughmcmaster

Thank you, I'll see if I can fit that into the Homebrew workflow.

mundschenk-at avatar Feb 13 '22 13:02 mundschenk-at

As a workaround, I forked the tap repo and changed the ffmpeg dependency to ffmpeg@4 (see here). One can now install loudgain using brew install marvin-klein/tap/loudgain.

marvin-klein avatar Feb 16 '22 10:02 marvin-klein

Please add this to the repo. I can confirm that this builds a binary if these 2 lines in scan.c are removed.

gearhead avatar Feb 28 '22 21:02 gearhead