Ask Your Question

cvandroid's profile - activity

2014-07-28 19:35:22 -0600 commented answer How to build OpenCV with TBB support?

And if cmake WITH_TBB=ON=ON followed by make still produces Use TBB: NO, what could be causing that?

2014-03-01 18:33:32 -0600 received badge  Supporter (source)
2013-11-27 23:17:32 -0600 received badge  Editor (source)
2013-11-27 16:45:12 -0600 asked a question Build OpenCV Under AOSP?

OpenCV4Android provides static libs for Android apps. But they are built with soft fp.

Furthermore, they do not link with command-line apps built as external modules of AOSP (command-line apps).

How can OpenCV4Android be built from source, so that it can be statically linked with command-line C++ apps built under the 'external' directory in AOSP?

What doesn't work:

Modifying platforms/scripts/cmake_android_arm.sh to include:

cmake -mfpu=neon -DANDROID_ABI="armeabi-v7a with NEON"  ...

export ANDROID_STANDALONE_TOOLCHAIN=$ANDROID_BUILD_TOP/prebuilts/ndk/android-ndk-r6
sh ./scripts/cmake_android_arm.sh

This fails because ANDROID_STANDALONE_TOOLCHAIN is apparently incorrect. While pointing using:

export ANDROID_NDK=~/dev/tool/android-ndk-r9b/

produces static libraries that are missing stdc++lib references, as well as references to libpng.

Example Error Output

/obj/STATIC_LIBRARIES/libopencv_core_intermediates/libopencv_core.a
(array.cpp.o): in function cvCreateMatHeader:array.cpp(
  .text.cvCreateMatHeader+0x13e): 
error: undefined reference to '__cxa_end_cleanup'

.../STATIC_LIBRARIES/libopencv_core_intermediates/libopencv_core.a(matrix.cpp.o): in function typeinfo for cv::MatAllocator:matrix.cpp(.data.rel.ro._ZTIN2cv12MatAllocatorE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'

Can OpenCV be compiled without the use of exceptions?