Ask Your Question
0

WARNING:jni/Android.mk:detection_based_tracker: non-system libraries in linker flags: -lopencv_java

asked 2013-10-07 09:27:49 -0600

achilles_xu gravatar image

build the opencv example "OpenCV-2.4.6-android-sdk\samples\face-detection",no error,but a warning "Android NDK: WARNING:jni/Android.mk:detection_based_tracker: non-system libraries in linker flags: -lopencv_java
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
Android NDK: current module
Install : libdetection_based_tracker.so => libs/armeabi-v7a/libdetection_based_tracker.so"

i can not solve the problem,need a help!!!image description

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2013-10-18 03:17:38 -0600

achilles_xu gravatar image

The answer is below, add three lines after "include $(CLEAR_VARS)" OPENCV_CAMERA_MODULES:=off OPENCV_INSTALL_MODULES:=on OPENCV_LIB_TYPE:=SHARED

the next line "include ../../sdk/native/jni/OpenCV.mk"

then press menu "Project----clear"

finally,get it!!!

now, i cannot still understand the android.mk,so i should be serious to read the docs in "android-ndk-r9\docs"

edit flag offensive delete link more

Comments

Could you show how your Android.mk file looks like now? I have this same problem and still can't solve it.

Zuku gravatar imageZuku ( 2013-10-27 08:39:35 -0600 )edit

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

OPENCV_CAMERA_MODULES:=off OPENCV_INSTALL_MODULES:=on OPENCV_LIB_TYPE:=SHARED include D:\OpenCV4Android\OpenCV-2.4.6-android-sdk\sdk\native\jni\OpenCV.mk

LOCAL_SRC_FILES := DetectionBasedTracker_jni.cpp LOCAL_C_INCLUDES += $(LOCAL_PATH) LOCAL_LDLIBS += -llog -ldl

LOCAL_MODULE := detection_based_tracker

include $(BUILD_SHARED_LIBRARY)

achilles_xu gravatar imageachilles_xu ( 2013-10-29 21:04:11 -0600 )edit
0

answered 2014-11-25 20:04:00 -0600

AuroraBlaze gravatar image

Hi,

I am facing the same issue as you too and, it took quite some time for me to fix it and I am not sure if it can help, but this is what I did. I know it is a bit late, but I hope it can help others who are facing the same issues as us too. Click onto the:

1) jni folder -> Android.mk 2) add in these codes: OPENCV_CAMERA_MODULES:= on OPENCV_INSTALL_MODULES:= on

3) Save and run.


This is what I have in my Android.mk file

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

OPENCV_CAMERA_MODULES:= on OPENCV_INSTALL_MODULES:= on

include ../../sdk/native/jni/OpenCV.mk

LOCAL_SRC_FILES := DetectionBasedTracker_jni.cpp LOCAL_C_INCLUDES += $(LOCAL_PATH) LOCAL_LDLIBS += -llog -ldl

LOCAL_MODULE := detection_based_tracker

include $(BUILD_SHARED_LIBRARY)


Well this is what I did and the warning sign is then gone. I followed the guide from this link dev_with_OCV_on_Android at "Application Development with Static Initialization" number 3.

"After that the OpenCV libraries will be copied to your application libs folder during the JNI build.v Eclipse will automatically include all the libraries from the libs folder to the application package (APK)."

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-10-07 09:27:49 -0600

Seen: 5,847 times

Last updated: Nov 25 '14