2

I am having problems using cvBlobsLib with my Android app. I am using Eclipse with NDK.

I have downloaded the library cvBlobsLib, created an Eclipse project using the source files of this library ,compiled it successfully using Eclipse and created the file libcvblobslib.a

When trying to use the libcvblobslib.a file in my project (in Eclipse again - Android+NDK project), I am getting an error that says:

Archive for required library: 'jni/cvblobslib_headers/libcvblobslib.a' in project 'MyProject' cannot be read or is not a valid ZIP file.

I cant figure out what the problem is... I added the libcvblobslib.a file to the build path, and all of the header files, together with the libcvblobslib.a are under the path jni/cvblobslib_headers/

I am able to use the openCV library without the cvBlobsLib, so I know that all the paths and configurations of the NDK are correct.

my android.mk is:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cvBlobsLib
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/cvblobslib_headers/
LOCAL_SRC_FILES := cvblobslib_headers/libcvblobslib.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
include ../../sdk/native/jni/OpenCV.mk
LOCAL_MODULE    := native_sample
LOCAL_SRC_FILES := jni_part.cpp 
LOCAL_STATIC_LIBRARIES = cvBlobsLib
LOCAL_LDLIBS +=  -llog -ldl
include $(BUILD_SHARED_LIBRARY)

And my Application.mk is :

APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a x86
APP_PLATFORM := android-11

PLEASE HELP!

Noamiko
  • 729
  • 11
  • 19

1 Answers1

0

OK, I found a partial solution but it doesn't use the static library way. Instead, I copied the source files into my project and compiled them as a shared library.

The compilation takes some time now, but at least it works now...

If someone knows how to do it statically I will be happy to know what am I missing...

Noamiko
  • 729
  • 11
  • 19