Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't compile android project wiht JNI code (algorithm not found)

I'm trying to build simple android app with some JNI code. I already try this suggestion, 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 path to my ndk-build

This is my path and symbols in eclipse

Can someone please help me? What could be causing this problem?

Thanks

like image 506
usil Avatar asked Mar 02 '26 05:03

usil


1 Answers

See my answer at your thread in answers.opencv.org

Should help

like image 127
Thomas Bergmueller Avatar answered Mar 04 '26 20:03

Thomas Bergmueller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!