libavutil: compile-/link-errors in tests during meson-build by missing dependency to liblzo
I came across this problem, as I used ffmpeg as a meson-subproject.
The compilation on meson-4.4
fails with multiple linker-errors of the kind:
/ffmpeg/build2/../libavutil/tests/lzo.c:56: undefined reference to 'lzo1x_999_compress'
To reproduce, execute the following steps:
- Start on a fresh environment, e.g. with:
docker run --rm -it --entrypoint /bin/bash ubuntu:22.04
- Install the necessary tools and the liblzo-headers:
apt update && apt install -y git meson gcc liblzo2-dev
- Clone and checkout the according repository and branch:
git clone --branch meson-4.4 --depth 1 https://gitlab.freedesktop.org/gstreamer/meson-ports/ffmpeg.git
- Build the project:
cd ffmpeg && meson setup build && meson compile -C build
The error-messages contain several other references, all related to liblzo/liblzo2.
I assume it could be fixed, by adding a dependency for this library to the build of the test within libavutil/meson.build
or disable the test, if the specific dependency is not available
Edited by Emanuel Schmidt