我想使用Android NDK将C ++库与我的Android项目集成。我自然将库放在src/main/cpp
文件夹中,并尝试构建该应用程序。但是,出现以下错误:
SIMPLE: Build command failed.
SIMPLE: Error while executing process /FwzFiles/android-sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/FwzFiles/GitHub/FaceRecognitionApp/app/src/main/cpp/Android.mk NDK_APPLICATION_MK=/FwzFiles/GitHub/FaceRecognitionApp/app/src/main/cpp/Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=/FwzFiles/GitHub/FaceRecognitionApp/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/FwzFiles/GitHub/FaceRecognitionApp/app/build/intermediates/ndkBuild/debug/lib NDK_DEBUG=1 NDEBUG=null APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
ERROR: *** Please specify environmental variable OPENCV_ANDROID_SDK to OpenCV Android SDK directory. Stop.
Open File
即使我已经下载了OpenCV SDK并设置了指向它的系统(Linux)环境变量-在我的系统中它位于/FwzFiles/OpenCV-android-sdk
-我仍然会收到此错误。
这是我的Android.mk
的一部分:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
ifndef OPENCV_ANDROID_SDK
$(error Please specify environmental variable OPENCV_ANDROID_SDK to OpenCV Android SDK directory)
endif
OPENCV_INSTALL_MODULES := on
include $(OPENCV_ANDROID_SDK)/sdk/native/jni/OpenCV.mk
ifndef EIGEN3_DIR
$(error Please specify environmental variable EIGEN3_DIR to Eigen 3 directory)
endif
那么如何将OPENCV_ANDROID_SDK
指向文件系统中的某个位置?