Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I can't compile JNI file

Hello,

This is the question I asked on stackoverflow., but nobody can help me.

http://stackoverflow.com/questions/19631634/cant-compile-android-project-wiht-jni-code-algorithm-not-found

I'm very frustrated, can someone here help me please?

Thanks

I can't compile JNI file

Hello,

This is the question I asked on stackoverflow., but nobody can help me.

http://stackoverflow.com/questions/19631634/cant-compile-android-project-wiht-jni-code-algorithm-not-found

I will ask the same question here. I'm very frustrated, can someone here help me please?trying to build simple android app with some JNI code. I already try this [suggestion][1], but isn't help

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 := all
APP_PLATFORM := android-8

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);

    }
}

![This is my path and symbols in eclipse

This is path to my ndk-build

Thanks