我正在尝试使用Cygwin为我的Android ndk应用程序创建.so文件。但Cygwin终端显示以下错误。
$ /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
我的jni文件夹中有以下文件 -
NotePaperDetector.hpp
NotePaperDetector.cpp
NoteDescription.hpp
NoteDescription.cpp
NoteLocation.hpp
NoteLocation.cpp
ImageUtils.hpp
ImageUtils.cpp
MarkerCandidate.hpp
MarkerCandidate.cpp
main.cpp
Android.mk文件是 -
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)
答案 0 :(得分:2)
系统无法找到OpenCV安装的路径。您需要将LOCAL_C_INCLUDES
变量添加到指向OpenCV
文件夹的Android.mk,即:
LOCAL_PATH := $(call my-dir)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../opencv