include /opt/OpenCV-2.4.0/share/OpenCV/OpenCV.mk
include $(CLEAR_VARS)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include /opt/OpenCV-2.4.0/share/OpenCV/OpenCV.mk #this is path to opencv.mk
LOCAL_MODULE := hello-jni
LOCAL_SRC_FILES := hello-jni.c
include $(BUILD_SHARED_LIBRARY)
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi-v7a/gdbserver
Gdbsetup : libs/armeabi-v7a/gdb.setup
Compile thumb : hello-jni <= hello-jni.c
SharedLibrary : libhello-jni.so
Install : libhello-jni.so => libs/armeabi-v7a/libhello-jni.so
Prebuilt : libnative_camera_r2.2.0.so <= /opt/OpenCV-2.4.0/share/OpenCV/../../libs/armeabi-v7a/
Install : libnative_camera_r2.2.0.so => libs/armeabi-v7a/libnative_camera_r2.2.0.so
Prebuilt : libnative_camera_r2.3.3.so <= /opt/OpenCV-2.4.0/share/OpenCV/../../libs/armeabi-v7a/
Install : libnative_camera_r2.3.3.so => libs/armeabi-v7a/libnative_camera_r2.3.3.so
Prebuilt : libnative_camera_r3.0.1.so <= /opt/OpenCV-2.4.0/share/OpenCV/../../libs/armeabi-v7a/
Install : libnative_camera_r3.0.1.so => libs/armeabi-v7a/libnative_camera_r3.0.1.so
Prebuilt : libnative_camera_r4.0.0.so <= /opt/OpenCV-2.4.0/share/OpenCV/../../libs/armeabi-v7a/
Install : libnative_camera_r4.0.0.so => libs/armeabi-v7a/libnative_camera_r4.0.0.so
Prebuilt : libnative_camera_r4.0.3.so <= /opt/OpenCV-2.4.0/share/OpenCV/../../libs/armeabi-v7a/
Install : libnative_camera_r4.0.3.so => libs/armeabi-v7a/libnative_camera_r4.0.3.so
Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/example/hellojni/HelloJni;
include $(CLEAR_VARS)
OPENCV_LIB_TYPE:=STATIC
include <your path>/OpenCV.mk
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -
fexceptions
APP_ABI := armeabi-v7a
OPENCV_LIB_TYPE:=STATIC
OPENCV_INSTALL_MODULES:=on
2596 could not load needed library 'libopencv_java.so' for 'libNativeProcessing.so'
./obj/local/armeabi-v7a/libopencv_core.a(persistence.cpp.o): In function `cv::toUtf16(std::string const&)':
persistence.cpp:(.text._ZN2cv7toUtf16ERKSs+0x6a): undefined reference to `std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&)'
persistence.cpp:(.text._ZN2cv7toUtf16ERKSs+0xb0): undefined reference to `std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_empty_rep_storage'
collect2: ld returned 1 exit status
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_LIB_TYPE:=STATIC
OPENCV_INSTALL_MODULES:=on
#to avoid conflicts between java OpenCV and C++ OpenCV
#OPENCV_CAMERA_MODULES:=off
#include ../OpenCV-2.3.1/share/OpenCV/OpenCV.mk
include ../OpenCV-2.4.1/share/opencv/OpenCV.mk
LOCAL_MODULE := NativeProcessing
### Add all source file names to be included in lib separated by a whitespace
LOCAL_SRC_FILES := NativeProcessing.cpp SomethingElse.cpp AnotherOne.cpp
LOCAL_LDLIBS += -llog #Enable inclusion of android/log.h
LOCAL_LDLIBS += -ldl
LOCAL_LDLIBS += -ljnigraphics #Enable inclusion of android/bitmap.h
include $(BUILD_SHARED_LIBRARY)
@zohob - what do you mean by ''several usages of 'clean''?? could you please explain the solution a bit in detail??
Dear Artem Storozhuk,
i am a student doing master in germany can you guide me how to install opencv ,i tryied to install but it wont run.
thanks in advance. |
|
Hi If I use the 2.4.3- rc. What NDK should I use? The latest available?
Thanks
OK, it seems I've understood the root of the problem:
When releasing the OpenCV4Android package, we usually compile our code with the latest available NDK, for 2.4.1 it's NDK-r8.
If you use older NDK version for your app-s JNI part compilation, it can fail due to internal NDK changes breaking binary compatibility.