libheif icon indicating copy to clipboard operation
libheif copied to clipboard

Linker fails to find Android logger

Open MajorMurphy opened this issue 2 years ago • 0 comments

Running build-android-libs.sh fails with the following error

[ 79%] Linking CXX executable encode ld: error: undefined symbol: __android_log_write referenced by catch.hpp:10374 (/home/vboxuser/GitHub/project/externals/libheif/tests/catch.hpp:10374) CMakeFiles/encode.dir/main.cc.o:(Catch::Detail::(anonymous namespace)::StreamBufImpl<Catch::Detail::(anonymous namespace)::OutputDebugWriter, 256u>::sync()) referenced by catch.hpp:10374 (/home/vboxuser/GitHub/project/externals/libheif/tests/catch.hpp:10374) CMakeFiles/encode.dir/main.cc.o:(Catch::Detail::(anonymous namespace)::StreamBufImpl<Catch::Detail::(anonymous namespace)::OutputDebugWriter, 256u>::overflow(int)) clang++: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [tests/CMakeFiles/encode.dir/build.make:146: tests/encode] Error 1 make[1]: *** [CMakeFiles/Makefile2:937: tests/CMakeFiles/encode.dir/all] Error 2 make: *** [Makefile:166: all] Error 2

This can be fixed with the cmake argument: -DCMAKE_CXX_STANDARD_LIBRARIES="-llog"

NDK version: 25.2.9519653 Min API level: 24

MajorMurphy avatar Feb 10 '24 21:02 MajorMurphy