Ask Your Question
0

Static Linking OpenCV 2.4.3.2

asked 2013-02-13 11:28:52 -0600

jameo gravatar image

I would like to statically link OpenCV(2.4.3.2) to my project. Right now my Android.mk looks like this

LOCAL_PATH := $(call my-dir)



include $(CLEAR_VARS)
OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on

include /Users/jamiematthews/Documents/Android-Projects/OpenCV-2.4.3-android-sdk/sdk/native/jni/OpenCV.mk

LOCAL_MODULE    := jni_part
LOCAL_SRC_FILES := jni_part.cpp
LOCAL_LDLIBS +=  -llog -ldl
LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog 
include $(BUILD_SHARED_LIBRARY)

Which throws the errors:

Android NDK: ERROR:/Users/jamiematthews/Documents/workspace/AuthentiGuard/jni/Android.mk:on: LOCAL_SRC_FILES points to a missing file    
/Users/jamiematthews/Documents/android-ndk-r8d/build/core/prebuilt-library.mk:43: *** Android NDK: Aborting    .  Stop.
Android NDK: Check that /Users/jamiematthews/Documents/Android-Projects/OpenCV-2.4.3-android-sdk/sdk/native/jni/../libs/mips/libon.so exists  or that its path is correct

Anyone know what this could mean?

PS if I remove the lines

OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on

it compiles fine, but then I cant statically link

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
2

answered 2013-02-22 02:05:23 -0600

To fix the problem in your SDK add following lines to file sdk/native/jni/OpenCV.mk after line 59:

ifeq ($(TARGET_ARCH_ABI),mips)
    OPENCV_CAMERA_MODULES:= native_camera_r4.0.3 native_camera_r4.1.1 native_camera_r4.2.0
endif

Solution for 2.4 branch has been already prepared and will be published with OpenCV 2.4.4 release.

edit flag offensive delete link more
0

answered 2013-02-21 08:14:22 -0600

I reproduce the same issue and create ticket on official OpenCV issue tracker.

edit flag offensive delete link more
0

answered 2013-02-21 08:18:42 -0600

jameo gravatar image

What I ended up doing was changing my Application.mk file to not include the mips (which I really didnt need anyway). So Now I build only for armeabi-v7a.

So to recap, I changed

APP_ABI := all

to

APP_ABI := armeabi-v7a
edit flag offensive delete link more
0

answered 2013-02-13 12:18:37 -0600

Are you not suppose to use

include $(BUILD_STATIC_LIBRARY)

instead?

edit flag offensive delete link more

Comments

I have never seen that like that in the docs anywhere. Also, I just tried it and it didnt work. Any other ideas???

jameo gravatar imagejameo ( 2013-02-13 12:26:17 -0600 )edit

Question Tools

Stats

Asked: 2013-02-13 11:28:52 -0600

Seen: 1,527 times

Last updated: Feb 22 '13