6

在我安装 ADT 并添加 CDT 和 NDK 并添加 OpenCV 库后出现此错误

**** Build of configuration Default for project OpenCV Tutorial 2 - Mixed Processing     ****

C:\android-ndk-r9\ndk-build.cmd 
jni/Android.mk:5: ../../sdk/native/jni/OpenCV.mk: No such file or directory
make: *** No rule to make target `../../sdk/native/jni/OpenCV.mk'.  Stop.

**** Build Finished ****

这是 Android.mk 代码

    LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

include ../../sdk/native/jni/OpenCV.mk

LOCAL_MODULE    := mixed_sample
LOCAL_SRC_FILES := jni_part.cpp
LOCAL_LDLIBS +=  -llog -ldl

include $(BUILD_SHARED_LIBRARY)
4

3 回答 3

10

更改Android.mkinclude 引用 OpenCV.mk 的绝对路径。前任:

WIN: include d:\dev\OpenCV-2.4.6-android-sdk\sdk\native\jni\OpenCV.mk
Linux: include ~/mydevdir/OpenCV-2.4.6-android-sdk/sdk/native/jni/OpenCV.mk
于 2013-08-07T06:42:01.040 回答
0

您是否知道在使用包含时,相对路径从您的项目目录开始,而不是从 project/jni 目录开始。确保您的目录结构如下所示,

  • -- sdk

    - 项目

并且您的包含行为:

include ../sdk/native/jni/OpenCV.mk
于 2013-08-07T07:15:44.610 回答
0

代码不在预期的位置。它期望OpenCV.mk文件存在于目录中../../sdk/native/jni/OpenCv.mk

于 2013-08-07T06:37:09.973 回答