Note that there are some explanatory texts on larger screens.

plurals
  1. POuse two library in the same JNI file
    primarykey
    data
    text
    <p>I'm using <strong>vuforia</strong> API to make an augmented reality application.Now I'm trying to integrate another library (<strong>opencv</strong>). I made changes in the <strong>android.mk</strong> file. But i still can't use opencv library and QCAR library in the same file .cpp I tried to access the java class to link between file which use QCAR and files which use OPENCV but this mapping is a time comsuming. I need to use the two library in the same file. this is my android.mk file:</p> <p>I edit the code as it was mentioned in the comments:</p> <pre><code>LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := QCAR-prebuilt LOCAL_SRC_FILES = ../../../build/lib/$(TARGET_ARCH_ABI)/libQCAR.so LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../build/include include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_PRELINK_MODULE := false OPENCV_LIB_TYPE:=STATIC include $(LOCAL_PATH)/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/OpenCV.mk LOCAL_MODULE := ImageTargets USE_OPENGL_ES_1_1 := false ifeq ($(USE_OPENGL_ES_1_1), true) OPENGLES_LIB := -lGLESv1_CM OPENGLES_DEF := -DUSE_OPENGL_ES_1_1 else OPENGLES_LIB := -lGLESv2 OPENGLES_DEF := -DUSE_OPENGL_ES_2_0 endif LOCAL_CFLAGS := -Wno-write-strings -Wno-psabi $(OPENGLES_DEF) LOCAL_LDLIBS += \ -llog $(OPENGLES_LIB) LOCAL_SHARED_LIBRARIES += QCAR-prebuilt LOCAL_SRC_FILES := ImageTargets.cpp SampleUtils.cpp Texture.cpp SampleMath.cpp LOCAL_ARM_MODE := arm include $(BUILD_SHARED_LIBRARY) </code></pre> <p>mon fichier application.mk:</p> <pre><code>APP_ABI := armeabi armeabi-v7a APP_PLATFORM := android-8 APP_STL := gnustl_static APP_CPPFLAGS := -frtti -fexceptions </code></pre> <p>when i build the project without adding any opencv function in my ImageTargets.cpp i get this:</p> <pre><code>E:\android-ndk-r8\ndk-build.cmd all "Compile++ arm : ImageTargets &lt;= ImageTargets.cpp "Compile++ arm : ImageTargets &lt;= SampleUtils.cpp "Compile++ arm : ImageTargets &lt;= Texture.cpp "Compile++ arm : ImageTargets &lt;= SampleMath.cpp Prebuilt : libopencv_contrib.a &lt;= jni/../../../OpenCV-2.4.5-android- sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_legacy.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_ml.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_stitching.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_objdetect.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_ts.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_videostab.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_calib3d.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_photo.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_video.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_features2d.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_highgui.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_androidcamera.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_flann.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_imgproc.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : libopencv_core.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../libs/armeabi/ Prebuilt : liblibjpeg.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi/ Prebuilt : liblibpng.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi/ Prebuilt : liblibtiff.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi/ Prebuilt : liblibjasper.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi/ Prebuilt : libIlmImf.a &lt;= jni/../../../OpenCV-2.4.5-android-sdk/sdk/native/jni/../3rdparty/libs/armeabi/ SharedLibrary : libImageTargets.so Install : libImageTargets.so =&gt; libs/armeabi/libImageTargets.so Install : libQCAR.so =&gt; libs/armeabi/libQCAR.so "Compile++ arm : ImageTargets &lt;= ImageTargets.cpp "Compile++ arm : ImageTargets &lt;= SampleUtils.cpp "Compile++ arm : ImageTargets &lt;= Texture.cpp "Compile++ arm : ImageTargets &lt;= SampleMath.cpp SharedLibrary : libImageTargets.so Install : libImageTargets.so =&gt; libs/armeabi-v7a/libImageTargets.so Install : libQCAR.so =&gt; libs/armeabi-v7a/libQCAR.so </code></pre> <p>But when i add an <code>opencv</code> function in the ImageTargets.cpp(which already use <code>QCAR library</code>) i get :<code>E:/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/..‌​/lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld.exe‌​: Warning: ./obj/local/armeabi/libopencv_core.a(array.cpp.o): Unknown EABI object attribute 44</code> Any ideas what am I doing wrong in this file? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload