Reputation: 262
I am trying to create .so files using Cygwin for my Android ndk application. But Cygwin terminal is showing following errors.
$ /cygdrive/c/native_work/android-ndk-r8b/ndk-build
Cygwin : Generating dependency file converter script
Compile++ thumb : main <= main.cpp
In file included from jni/NotePaperDetector.hpp:4:0,
from jni/main.cpp:1:
jni/NoteLocation.hpp:4:30: fatal error: opencv2/opencv.hpp: No such file or directory
compilation terminated.
/cygdrive/c/native_work/android-ndk-r8b/build/core/build-binary.mk:255: recipe for target `obj/local/armeabi/objs/main /main.o' failed
make: *** [obj/local/armeabi/objs/main/main.o] Error 1
I have the following files in my jni folder -
NotePaperDetector.hpp
NotePaperDetector.cpp
NoteDescription.hpp
NoteDescription.cpp
NoteLocation.hpp
NoteLocation.cpp
ImageUtils.hpp
ImageUtils.cpp
MarkerCandidate.hpp
MarkerCandidate.cpp
main.cpp
Android.mk file is -
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# Here we give our module name and source file(s)
LOCAL_MODULE := main
LOCAL_SRC_FILES := main.cpp
include $(BUILD_SHARED_LIBRARY)
Upvotes: 2
Views: 1298
Reputation: 25386
The system cannot find path to OpenCV installation. You need to add LOCAL_C_INCLUDES
variable to Android.mk pointing to the OpenCV
folder, i.e:
LOCAL_PATH := $(call my-dir)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../opencv
Upvotes: 2