create a 3rd party android library using opencv and cmake toolchain

Skip to first unread message

Andrei Zaharescu

Oct 22, 2012, 1:55:24 PM10/22/12
hi there,

I'm encountering problems when trying to compile and use another library (let us name it CoreVision) that uses opencv and cmake.

The library is using a cmake file and I'm using the opencv 2.4.2 android.toolchain.cmake file provided, as well as the OpenCVConfig.cmake from the Opencv-2.4.2/sdk/native/jni folder.

The library cross-compiles successfully.
I try to add it to (and modify) one of the opencv android examples that uses JNI (I named the library that contains the JNI code CoreVisionIntegration), but everything explodes when I try to load the CoreVision library. 
While I do not know the exact cause, since the stack trace is not showing any useful information, the library has some static variables that are initialized to OpenCV types. Upon inspection of with the arm objdump, I notice that it does not link against, as is the

Any ideas on why that might be the case?

Andrei Zaharescu

Oct 22, 2012, 4:35:40 PM10/22/12
I've reduced the problem to a very simple toy example that can be reduced to the following: if I have a global variable of static member function that is of OpenCV class type, the library crashes when it is loaded from java via LoadLibrary.

Reply all
Reply to author
0 new messages