<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 4.1.2</li>
<li>Operating System / Platform =&gt; Mac</li>
<li>Compiler =&gt; clang</li>
</ul>
<h5 dir="auto">Detailed description</h5>

<p dir="auto">Detected processor: armv7-a<br>
sizeof(void) = 4 on 64 bit processor. Assume 32-bit compilation mode<br>
Looking for ccache - not found<br>
FP16 is not supported by C++ compiler<br>
OpenCV disables pkg-config to avoid using of host libraries. Consider using PKG_CONFIG_LIBDIR to specify target SYSROOT<br>
libjpeg-turbo: VERSION = 2.0.2, BUILD = opencv-4.1.2-libjpeg-turbo<br>
Android SDK Tools: Ant (Eclipse) builds are NOT supported by Android SDK<br>
Android SDK Build Tools: Gradle 3.0.0+ builds support is available<br>
Android SDK Tools: Prepare Android projects for using Gradle 3.0.0+ build scripts<br>
Android Gradle Plugin version: 3.2.1<br>
Caffe:   NO<br>
Protobuf:   NO<br>
Glog:   NO<br>
freetype2:   NO<br>
harfbuzz:    NO<br>
Module opencv_ovis disabled because OGRE3D was not found<br>
No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.<br>
Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.<br>
Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.<br>
Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h<br>
Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h<br>
Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags<br>
Module opencv_dnn_objdetect disabled because opencv_dnn dependency can't be resolved!<br>
Module opencv_dnn_superres disabled because opencv_dnn dependency can't be resolved!<br>
Module opencv_text disabled because opencv_dnn dependency can't be resolved!<br>
Excluding from source files list: modules/imgproc/src/corner.avx.cpp<br>
Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp<br>
Excluding from source files list: modules/imgproc/src/imgwarp.sse4_1.cpp<br>
Excluding from source files list: modules/imgproc/src/resize.avx2.cpp<br>
Excluding from source files list: modules/imgproc/src/resize.sse4_1.cpp<br>
Excluding from source files list: modules/imgproc/src/sumpixels.avx512_skx.cpp<br>
Excluding from source files list: modules/features2d/src/fast.avx2.cpp<br>
Android OpenCV Manager is ignored</p>
<p dir="auto">General configuration for OpenCV 4.1.2 =====================================<br>
Version control:               unknown</p>
<p dir="auto">Extra modules:<br>
Location (extra):            /Users/Elvis/Downloads/OpenCV/opencv-contrib/modules<br>
Version control (extra):     unknown</p>
<p dir="auto">Platform:<br>
Timestamp:                   2019-11-29T17:39:44Z<br>
Host:                        Darwin 19.0.0 x86_64<br>
Target:                      Android 1 armv7-a<br>
CMake:                       3.16.0-rc4<br>
CMake generator:             Unix Makefiles<br>
CMake build tool:            /usr/bin/make<br>
Configuration:               Release</p>
<p dir="auto">CPU/HW features:<br>
Baseline:<br>
requested:                 DETECT</p>
<p dir="auto">C/C++:<br>
Built as dynamic libs?:      NO<br>
C++ Compiler:                /Users/Elvis/Library/Android/sdk/ndk/19.2.5345600/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++  (ver 8.0)<br>
C++ flags (Release):         -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments  -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG   -DNDEBUG<br>
C++ flags (Debug):           -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments  -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info   -DDEBUG -D_DEBUG<br>
C Compiler:                  /Users/Elvis/Library/Android/sdk/ndk/19.2.5345600/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang<br>
C flags (Release):           -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments  -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG   -DNDEBUG<br>
C flags (Debug):             -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments  -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info   -DDEBUG -D_DEBUG<br>
Linker flags (Release):      -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now<br>
Linker flags (Debug):        -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now<br>
ccache:                      NO<br>
Precompiled headers:         NO<br>
Extra dependencies:          /Users/Elvis/Library/Android/sdk/ndk/19.2.5345600/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/libz.a dl m log<br>
3rdparty dependencies:       libcpufeatures ittnotify libjpeg-turbo libwebp libpng libtiff libjasper IlmImf quirc tegra_hal</p>
<p dir="auto">OpenCV modules:<br>
To be built:                 aruco bgsegm bioinspired calib3d ccalib core dpm face features2d flann fuzzy hfs highgui img_hash imgcodecs imgproc java line_descriptor ml objdetect optflow phase_unwrapping photo plot quality rgbd saliency shape stereo stitching structured_light superres surface_matching tracking video videoio videostab xfeatures2d ximgproc xobjdetect xphoto<br>
Disabled:                    datasets dnn reg world<br>
Disabled by dependency:      dnn_objdetect dnn_superres text<br>
Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype gapi hdf js matlab ovis python2 python3 sfm ts viz<br>
Applications:                android_service<br>
Documentation:               NO<br>
Non-free algorithms:         YES</p>
<p dir="auto">Android NDK:                   /Users/Elvis/Library/Android/sdk/ndk/19.2.5345600 (ver 19.2.5345600)<br>
Android ABI:                 arm64-v8a<br>
NDK toolchain:               aarch64-linux-android-clang<br>
STL type:                    c++_static<br>
Native API level:            28<br>
Android SDK:                   /Users/Elvis/Library/Android/sdk (tools: 26.1.1 build tools: 29.0.2)</p>
<p dir="auto">GUI:</p>
<p dir="auto">Media I/O:<br>
ZLib:                        /Users/Elvis/Library/Android/sdk/ndk/19.2.5345600/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/libz.a (ver 1.2.7)<br>
JPEG:                        build-libjpeg-turbo (ver 2.0.2-62)<br>
WEBP:                        build (ver encoder: 0x020e)<br>
PNG:                         build (ver 1.6.37)<br>
TIFF:                        build (ver 42 - 4.0.10)<br>
JPEG 2000:                   build (ver 1.900.1)<br>
OpenEXR:                     build (ver 2.3.0)<br>
HDR:                         YES<br>
SUNRASTER:                   YES<br>
PXM:                         YES<br>
PFM:                         YES</p>
<p dir="auto">Video I/O:</p>
<p dir="auto">Parallel framework:            pthreads</p>
<p dir="auto">Trace:                         YES (with Intel ITT)</p>
<p dir="auto">Other third-party libraries:<br>
Custom HAL:                  YES (carotene (ver 0.0.1))<br>
Protobuf:                    build (3.5.1)</p>
<p dir="auto">Python (for build):            /usr/bin/python2.7</p>
<p dir="auto">Java:                          export all functions<br>
ant:                         NO<br>
Java wrappers:               YES<br>
Java tests:                  NO</p>
<h2 dir="auto">Install to:                    /Users/Elvis/Downloads/OpenCV/opencv-android/install</h2>
<p dir="auto">Configuring done<br>
Generating done</p>
<h5 dir="auto">Steps to reproduce</h5>

<p dir="auto">[ 99%] Built target opencv_java_android_source_copy<br>
[ 99%] Linking CXX shared library ../../../jni/arm64-v8a/libopencv_java4.so<br>
../../../lib/arm64-v8a/libopencv_phase_unwrapping.a: error adding symbols: Archive has no index; run ranlib to add one<br>
clang++: error: linker command failed with exit code 1 (use -v to see invocation)<br>
make[2]: *** [jni/arm64-v8a/libopencv_java4.so] Error 1<br>
make[1]: *** [modules/java/jni/CMakeFiles/opencv_java.dir/all] Error 2<br>
make: *** [all] Error 2</p>
<ul dir="auto">
<li>

<ul dir="auto">
<li>OpenCV =&gt; 3.4.4</li>
<li>Operating System / Platform =&gt; Android (Windows 10 compile host)</li>
<li>Compiler =&gt; MinGW 5.3.0 32bit</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I am compiling OpenCV 3.4.4 (world) from source for Android on a Windows 10 host. The compilation of the shared OpenCV libraries seems to finish without error EXCEPT for when <code class="notranslate">hello_android</code> is being linked.</p>
<h6 dir="auto">CMake config</h6>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="-- General configuration for OpenCV 3.4.4 =====================================
--   Version control:               3.4.4
--
--   Platform:
--     Timestamp:                   2019-03-01T03:15:46Z
--     Host:                        Windows 10.0.17763 AMD64
--     Target:                      Android 1 aarch64
--     CMake:                       3.13.0-rc2
--     CMake generator:             MinGW Makefiles
--     CMake build tool:            C:/Qt/Qt5.11.2/Tools/mingw530_32/bin/mingw32-make.exe
--     Configuration:               Release
--
--   CPU/HW features:
--     Baseline:                    NEON FP16
--       required:                  NEON
--       disabled:                  VFPV3
--
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++11:                       YES
--     C++ Compiler:                C:/android-ndk-r19b-windows-x86_64/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe  (ver 8.0)
--     C++ flags (Release):         -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG   -DNDEBUG
--     C++ flags (Debug):           -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info   -DDEBUG -D_DEBUG
--     C Compiler:                  C:/android-ndk-r19b-windows-x86_64/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
--     C flags (Release):           -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG   -DNDEBUG
--     C flags (Debug):             -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info   -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
--     Linker flags (Debug):        -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          dl m log
--     3rdparty dependencies:
--
--   OpenCV modules:
--     To be built:                 calib3d core dnn features2d flann highgui imgcodecs imgproc java_bindings_generator ml objdetect photo shape stitching superres video videostab world
--     Disabled:                    videoio
--     Disabled by dependency:      -
--     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java js python2 python3 ts viz
--     Applications:                -
--     Documentation:               NO
--     Non-free algorithms:         NO
--
--   Android NDK:                   C:/android-ndk-r19b-windows-x86_64 (ver 19.1.5304403)
--     Android ABI:                 arm64-v8a
--     NDK toolchain:               aarch64-linux-android-clang
--     STL type:                    c++_static
--     Native API level:            23
--   Android SDK:                   not used, projects are not built
--
--   GUI:
--
--   Media I/O:
--     ZLib:                        C:/android-ndk-r19b-windows-x86_64/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/libz.a (ver 1.2.7)
--     JPEG:                        build-libjpeg-turbo (ver 1.5.3-62)
--     WEBP:                        build (ver encoder: 0x020e)
--     PNG:                         build (ver 1.6.35)
--     TIFF:                        build (ver 42 - 4.0.9)
--     JPEG 2000:                   build (ver 1.900.1)
--     OpenEXR:                     build (ver 1.7.1)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--
--   Video I/O:
--
--   Parallel framework:            TBB (ver 2018.0 interface 10001)
--
--   Trace:                         YES (built-in)
--
--   Other third-party libraries:
--     Custom HAL:                  YES (carotene (ver 0.0.1))
--     Protobuf:                    build (3.5.1)
--
--   OpenCL:                        YES (no extra features)
--     Include path:                C:/Users/Lenovo/Desktop/opencv/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
--
--   Python (for build):            NO
--
--   Java:
--     ant:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
--
--   Install to:                    C:/Users/Lenovo/Desktop/opencv/build-android-world/install
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Lenovo/Desktop/opencv/build-android-world"><pre class="notranslate"><code class="notranslate">-- General configuration for OpenCV 3.4.4 =====================================
--   Version control:               3.4.4
--
--   Platform:
--     Timestamp:                   2019-03-01T03:15:46Z
--     Host:                        Windows 10.0.17763 AMD64
--     Target:                      Android 1 aarch64
--     CMake:                       3.13.0-rc2
--     CMake generator:             MinGW Makefiles
--     CMake build tool:            C:/Qt/Qt5.11.2/Tools/mingw530_32/bin/mingw32-make.exe
--     Configuration:               Release
--
--   CPU/HW features:
--     Baseline:                    NEON FP16
--       required:                  NEON
--       disabled:                  VFPV3
--
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++11:                       YES
--     C++ Compiler:                C:/android-ndk-r19b-windows-x86_64/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe  (ver 8.0)
--     C++ flags (Release):         -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG   -DNDEBUG
--     C++ flags (Debug):           -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info   -DDEBUG -D_DEBUG
--     C Compiler:                  C:/android-ndk-r19b-windows-x86_64/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
--     C flags (Release):           -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG   -DNDEBUG
--     C flags (Debug):             -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info   -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
--     Linker flags (Debug):        -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          dl m log
--     3rdparty dependencies:
--
--   OpenCV modules:
--     To be built:                 calib3d core dnn features2d flann highgui imgcodecs imgproc java_bindings_generator ml objdetect photo shape stitching superres video videostab world
--     Disabled:                    videoio
--     Disabled by dependency:      -
--     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java js python2 python3 ts viz
--     Applications:                -
--     Documentation:               NO
--     Non-free algorithms:         NO
--
--   Android NDK:                   C:/android-ndk-r19b-windows-x86_64 (ver 19.1.5304403)
--     Android ABI:                 arm64-v8a
--     NDK toolchain:               aarch64-linux-android-clang
--     STL type:                    c++_static
--     Native API level:            23
--   Android SDK:                   not used, projects are not built
--
--   GUI:
--
--   Media I/O:
--     ZLib:                        C:/android-ndk-r19b-windows-x86_64/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/libz.a (ver 1.2.7)
--     JPEG:                        build-libjpeg-turbo (ver 1.5.3-62)
--     WEBP:                        build (ver encoder: 0x020e)
--     PNG:                         build (ver 1.6.35)
--     TIFF:                        build (ver 42 - 4.0.9)
--     JPEG 2000:                   build (ver 1.900.1)
--     OpenEXR:                     build (ver 1.7.1)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--
--   Video I/O:
--
--   Parallel framework:            TBB (ver 2018.0 interface 10001)
--
--   Trace:                         YES (built-in)
--
--   Other third-party libraries:
--     Custom HAL:                  YES (carotene (ver 0.0.1))
--     Protobuf:                    build (3.5.1)
--
--   OpenCL:                        YES (no extra features)
--     Include path:                C:/Users/Lenovo/Desktop/opencv/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
--
--   Python (for build):            NO
--
--   Java:
--     ant:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
--
--   Install to:                    C:/Users/Lenovo/Desktop/opencv/build-android-world/install
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Lenovo/Desktop/opencv/build-android-world
</code></pre></div>
<p dir="auto">As mentioned before, both <code class="notranslate">libopencv_world.so</code> and <code class="notranslate">libtbb.so</code> seems to have been correctly built. They can be found in <code class="notranslate">C:\Users\Lenovo\Desktop\opencv\build-android-world\lib\arm64-v8a</code>. However, linking of <code class="notranslate">hello_android</code> results in undefined references to <code class="notranslate">tbb::</code> functions.</p>
<h6 dir="auto">mingw32-make output</h6>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[  0%] Built target libcpufeatures
[  6%] Built target libjpeg-turbo
[ 10%] Built target libtiff
[ 23%] Built target libwebp
[ 27%] Built target libjasper
[ 29%] Built target libpng
[ 37%] Built target IlmImf
[ 40%] Built target tbb
[ 49%] Built target libprotobuf
[ 50%] Built target quirc
[ 56%] Built target carotene_objs
[ 57%] Built target tegra_hal
[100%] Built target opencv_world
[100%] Linking CXX executable ..\..\bin\hello-android
C:/android-ndk-r19b-windows-x86_64/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: warning: libtbb.so, needed by ..\..\lib\arm64-v8a\libopencv_world.so, not found (try using -rpath or -rpath-link)
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::internal::get_initial_auto_partitioner_divisor()'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::task::note_affinity(unsigned short)'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_initialize()'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `typeinfo for tbb::task'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_execute(tbb::interface7::internal::delegate_base&amp;) const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::task_group_context::init()'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::task_group_context::is_group_execution_cancelled() const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_current_slot()'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_max_concurrency(tbb::interface7::task_arena const*)'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::task_group_context::~task_group_context()'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::internal::allocate_root_with_context_proxy::free(tbb::task&amp;) const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_terminate()'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
samples\android\CMakeFiles\hello-android.dir\build.make:83: recipe for target 'bin/hello-android' failed
mingw32-make[2]: *** [bin/hello-android] Error 1
CMakeFiles\Makefile2:1994: recipe for target 'samples/android/CMakeFiles/hello-android.dir/all' failed
mingw32-make[1]: *** [samples/android/CMakeFiles/hello-android.dir/all] Error 2
Makefile:161: recipe for target 'all' failed
mingw32-make: *** [all] Error 2"><pre class="notranslate"><code class="notranslate">[  0%] Built target libcpufeatures
[  6%] Built target libjpeg-turbo
[ 10%] Built target libtiff
[ 23%] Built target libwebp
[ 27%] Built target libjasper
[ 29%] Built target libpng
[ 37%] Built target IlmImf
[ 40%] Built target tbb
[ 49%] Built target libprotobuf
[ 50%] Built target quirc
[ 56%] Built target carotene_objs
[ 57%] Built target tegra_hal
[100%] Built target opencv_world
[100%] Linking CXX executable ..\..\bin\hello-android
C:/android-ndk-r19b-windows-x86_64/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: warning: libtbb.so, needed by ..\..\lib\arm64-v8a\libopencv_world.so, not found (try using -rpath or -rpath-link)
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::internal::get_initial_auto_partitioner_divisor()'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::task::note_affinity(unsigned short)'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_initialize()'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `typeinfo for tbb::task'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_execute(tbb::interface7::internal::delegate_base&amp;) const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::task_group_context::init()'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::task_group_context::is_group_execution_cancelled() const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_current_slot()'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_max_concurrency(tbb::interface7::task_arena const*)'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::task_group_context::~task_group_context()'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::internal::allocate_root_with_context_proxy::free(tbb::task&amp;) const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const'
..\..\lib\arm64-v8a\libopencv_world.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_terminate()'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
samples\android\CMakeFiles\hello-android.dir\build.make:83: recipe for target 'bin/hello-android' failed
mingw32-make[2]: *** [bin/hello-android] Error 1
CMakeFiles\Makefile2:1994: recipe for target 'samples/android/CMakeFiles/hello-android.dir/all' failed
mingw32-make[1]: *** [samples/android/CMakeFiles/hello-android.dir/all] Error 2
Makefile:161: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
</code></pre></div>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">Path to opencv source: <code class="notranslate">C:\Users\Lenovo\Desktop\opencv</code><br>
Path to build directory: <code class="notranslate">C:\Users\Lenovo\Desktop\opencv\build-android-world</code></p>
<h6 dir="auto">CMake invocation</h6>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cmake .. -G &quot;MinGW Makefiles&quot; ^
  -DANDROID_ABI=arm64-v8a ^
  -DANDROID_NATIVE_API_LEVEL=23 ^
  -DANDROID_ARM_NEON=ON ^
  -DANDROID_TOOLCHAIN=clang ^
  -DCMAKE_TOOLCHAIN_FILE=C:/android-ndk-r19b-windows-x86_64/build/cmake/android.toolchain.cmake ^
  -DANDROID_NDK=C:/android-ndk-r19b-windows-x86_64 ^
  -DANDROID_SDK=C:/Users/Lenovo/android-sdk ^
  -DBUILD_SHARED_LIBS=ON ^
  -DCMAKE_BUILD_TYPE=Release ^
  -DBUILD_ANDROID_PROJECTS=OFF ^
  -DWITH_OPENCL=ON ^
  -DWITH_TBB=ON ^
  -DENABLE_NEON=ON ^
  -DENABLE_CXX11=ON ^
  -DBUILD_TESTS=OFF ^
  -DBUILD_PERF_TESTS=OFF ^
  -DBUILD_opencv_videoio=OFF ^
  -DBUILD_opencv_world=ON

mingw32-make [-j4]"><pre class="notranslate"><code class="notranslate">cmake .. -G "MinGW Makefiles" ^
  -DANDROID_ABI=arm64-v8a ^
  -DANDROID_NATIVE_API_LEVEL=23 ^
  -DANDROID_ARM_NEON=ON ^
  -DANDROID_TOOLCHAIN=clang ^
  -DCMAKE_TOOLCHAIN_FILE=C:/android-ndk-r19b-windows-x86_64/build/cmake/android.toolchain.cmake ^
  -DANDROID_NDK=C:/android-ndk-r19b-windows-x86_64 ^
  -DANDROID_SDK=C:/Users/Lenovo/android-sdk ^
  -DBUILD_SHARED_LIBS=ON ^
  -DCMAKE_BUILD_TYPE=Release ^
  -DBUILD_ANDROID_PROJECTS=OFF ^
  -DWITH_OPENCL=ON ^
  -DWITH_TBB=ON ^
  -DENABLE_NEON=ON ^
  -DENABLE_CXX11=ON ^
  -DBUILD_TESTS=OFF ^
  -DBUILD_PERF_TESTS=OFF ^
  -DBUILD_opencv_videoio=OFF ^
  -DBUILD_opencv_world=ON

mingw32-make [-j4]
</code></pre></div>
<p dir="auto">This leads eventually to <a href="#mingw32-make-output">mingw32-make output</a> above</p></li></ul>