Description
System information (version)
- OpenCV = 4.1.1
- Operating System / Platform => Ubuntu 16.04 64bit
- Compiler => cmake 3.13.4
Detailed description
I used android-ndk-r17c
or android-ndk-r18b
compile for android,success
.
if i used android-ndk-r19c
or android-ndk-r20
,failed:
[ 57%] Linking CXX shared library ../../lib/armeabi-v7a/libopencv_core.so
bionic/libc/include/bits/fortify/stdio.h:70: error: undefined reference to '__vsnprintf_chk'
bionic/libc/include/bits/fortify/stdio.h:43: error: undefined reference to '__vsnprintf_chk'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
modules/core/CMakeFiles/opencv_core.dir/build.make:1345: recipe for target 'lib/armeabi-v7a/libopencv_core.so' failed
make[2]: *** [lib/armeabi-v7a/libopencv_core.so] Error 1
CMakeFiles/Makefile2:1509: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 57%] Linking CXX static library ../lib/armeabi-v7a/libIlmImf.a
[ 57%] Built target IlmImf
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
cmake command is:
cmake .. -DINSTALL_ANDROID_EXAMPLES=OFF \
-DANDROID_EXAMPLES_WITH_LIBS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_DOCS=OFF \
-DWITH_OPENCL=OFF \
-DWITH_IPP=ON \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
-DANDROID_TOOLCHAIN=clang \
-DANDROID_STL=c++_shared \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_ANDROID_PROJECTS=OFF \
-DBUILD_ANDROID_EXAMPLES=OFF \
-DBUILD_PREF_TESTS=OFF \
-DBUILD_TESTS=OFF \
-DANDROID_ABI=armeabi-v7a \
-DANDROID_SDK_TARGET=21
after cmake command finished:
make -j8
failed.
Activity
alalek commentedon Sep 13, 2019
Can't reproduce with NDK18b. Please compare logs with ours (
make VERBOSE=1
).typo in
PERF
andforce commentedon Sep 14, 2019
@alalek
thanks, i tried with
NDK18b
, it's success.but even failed with
android-ndk-r19c
orandroid-ndk-r20
log:
alalek commentedon Sep 14, 2019
Seems related: android/ndk#1069
Try to force zlib from OpenCV:
cmake -DBUILD_ZLIB=ON ...
andforce commentedon Sep 14, 2019
@alalek
thans very munch~
i compile success when add
-DBUILD_ZLIB=ON
compile withandroid-ndk-r19c
ANDandroid-ndk-r20
the complete cmake command is: