Issue
In the android.mk
file I want to include the OpenCV3
library. so the file looks like this:
android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_EXPORT_C_INCLUDES := D:\path to\OpenCV-android-sdk\sdk\native\jni\include
include D:\path to\OpenCV-android-sdk\sdk\native\jni\OpenCV.mk
LOCAL_MODULE := MyLib
LOCAL_SRC_FILES := file1.cpp
LOCAL_SRC_FILES += file2.cpp
OPENGLES_LIB := -lGLESv1_CM
OPENGLES_DEF := -DUSE_OPENGL_ES_1_1
LOCAL_LDLIBS += -lGLESv1_CM -ldl -llog
include $(BUILD_SHARED_LIBRARY)
But when I build the project, I got this warning message:
Android NDK: WARNING:jni/Android.mk:MyLib: non-system libraries in linker flags: -lopencv_java3
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
How can I solve this issue ?
Solution
If you only use OpenCV from your C++ code, you don't need this libopencv_java.so. To indicate this, add
OPENCV_LIB_TYPE=STATIC
Before including OpenCV.mk.
Some explanations can be found at answers.opencv.org.
Answered By - Alex Cohn
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.