First time here? Check out the FAQ!

Ask Your Question
0

Static Linking OpenCV 2.4.3.2

asked Feb 13 '13

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

Preview: (hide)

4 answers

Sort by » oldest newest most voted
2

answered Feb 22 '13

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.

Preview: (hide)
0

answered Feb 21 '13

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

Preview: (hide)
0

answered Feb 21 '13

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
Preview: (hide)
0

answered Feb 13 '13

Are you not suppose to use

include $(BUILD_STATIC_LIBRARY)

instead?

Preview: (hide)

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 (Feb 13 '13)edit

Question Tools

Stats

Asked: Feb 13 '13

Seen: 1,541 times

Last updated: Feb 22 '13