Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Android undefined reference to 'cvUpdateMotionHistory'

I am trying to use opencv source code from Windows in Android. So I want to use native C/C++ opencv code in android. I followed this tutorial to do it : http://docs.opencv.org/2.4/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html

Everything work perfectly, except this line :

cvUpdateMotionHistory(p_silhouette, p_mhi, timestamp, MHI_DURATION);

I get this error when I run "ndk-build APP_ABI=all APP_STL=gnustl_static" :

error: undefined reference to 'cvUpdateMotionHistory'

Android.mk :

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_LIB_TYPE := STATIC
OPENCV_INSTALL_MODULES := on
OPENCV_CAMERA_MODULES := off
include D:/Resources/opencv_v310_android/sdk/native/jni/OpenCV.mk
LOCAL_MODULE := Motor
LOCAL_SRC_FILES := package_Motor.cpp
LOCAL_SRC_FILES += motor/motor.cpp
LOCAL_LDFLAGS := -llog
include $(BUILD_SHARED_LIBRARY)

Do you have any idea how to solve this problem? Thanks.