I can't compile android projetc wiht JNI code
Posted
by
lobi
on Stack Overflow
See other posts from Stack Overflow
or by lobi
Published on 2013-10-28T09:52:10Z
Indexed on
2013/10/28
9:53 UTC
Read the original article
Hit count: 608
I'm trying to build simple android app with some JNI code.
When I press build project in eclipse I get this error:
Description Resource Path Location Type
fatal error: algorithm: No such file or directory Tracker line 56, external location: /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/include/opencv2/core/core.hpp C/C++ Problem
make: *** [obj/local/armeabi/objs/detect_jni/detect_jni.o] Error 1 Tracker C/C++ Problem
Line 56 in core.hpp contains the relevant include.
This is my Android.mk file jni folder:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include /home/slani/code/OpenCV-2.4.6-android-sdk/sdk/native/jni/OpenCV.mk
LOCAL_MODULE := detect_jni
LOCAL_SRC_FILES := detect_jni.cpp
include $(BUILD_SHARED_LIBRARY)
This is my Aplication.mk file in jni folder:
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a
APP_PLATFORM := all
This is my .cpp file:
#include <jni.h>
#include <opencv/cv.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
using namespace cv;
extern "C"{
JNIEXPORT void JNICALL Java_com_slani_tracker_OpenCamera_findObject((JNIEnv *env, jlong addRgba, jlong addHsv);
JNIEXPORT void JNICALL Java_com_slani_tracker_OpenCamera_findObject((JNIEnv *env, jlong addRgba, jlong addHsv)
{
Mat& rgba = *(Mat*)addRgba;
Mat& hsv = *(Mat*)addHsv;
cvtColor(rgba, hsv,CV_RGBA2HSV);
}
}
Can someone please help me? What could be causing this problem?
Thanks
© Stack Overflow or respective owner