我正在使用Android Studio进行Android OpenCV开发,但是当我编译在Eclipse中正常的项目时,出现了以下错误:
D:\software\AndroidStudioProjects\CameraMe\openCVSamplefacedetection\src\main\jni\DetectionBasedTracker_jni.cpp:2:33: fatal error: opencv2/core/core.hpp: No such file or directory
我猜想opencv的头文件没有找到,但我不知道问题出在哪里。
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#OPENCV_CAMERA_MODULES:=off
#OPENCV_INSTALL_MODULES:=off
#OPENCV_LIB_TYPE:=SHARED
include D:\eclipse\OpenCV_2.4.9_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)
Application.mk
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a
APP_PLATFORM := android-8
DetectionBasedTracker_jni.cpp
#include <DetectionBasedTracker_jni.h>
#include <opencv2/core/core.hpp>
#include <opencv2/contrib/detection_based_tracker.hpp>
......