我正在尝试在Android NDK上编译依赖于OpenCV的C ++代码。 我已经查看了几个答案(主要是this)但显然NDK仍然无法在LOCAL_C_INCLUDES变量中看到我给它的目录。
这是我的Application.mk:
APP_ABI :=armeabi armeabi-v7a
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_PLATFORM :=android-14
NDK_TOOLCHAIN_VERSION=4.7
这是我的Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE:= swt
LOAL_CPP_EXTENSIO:=.cpp
LOCAL_C_INCLUDES := /usr/include:/usr/include/i386-linux-gnu:/usr/include/i386-linux-gnu/bits:/usr/include/i386-linux-gnu/sys:/usr/include/i386-linux-gnu/gnu:/usr/include/i386-linux-gnu/asm:/home/hamdy/Downloads/android-ndk-r8e/sources:/usr/local/include/opencv:/usr/local/include/opencv2/core
LOCAL_CFLAFS := -x c++ -lopencv_core -lopencv_highgui -lopencv_imgproc
LOCAL_SRC_FILES := TextDetection.cpp FeaturesMain.cpp
include $(BUILD_SHARED_LIBRARY)
这是我得到的错误[cv.h是我的.cpp中包含的文件,所以它显然可以在/ usr / local / include / opencv目录中看到但是无法通过其中的包含]:
/usr/local/include/opencv/cv.h:63:33: fatal error: opencv2/core/core_c.h: No such file or directory
compilation terminated.
答案 0 :(得分:0)
我不知道为什么但是当我在Linux下编译相同的东西时,一切编译得很好。在Windows下有错误。所以我已经切换到了Linux