在 Eclipse 上安装 OpenCV for Android 的问题:各种错误,包括"在 PATH 中找不到"

Issues with installing OpenCV for Android on Eclipse: various errors including "not found in PATH"

本文关键字:错误 找不到 包括 PATH 安装 Eclipse OpenCV for Android 问题      更新时间:2023-10-16

我试图在Eclipse (Windows 8)上安装OpenCV for Android .我遵循了以下三个教程:http://www.youtube.com/watch?v=N2onPuDZQVY一步一步地找到,但当我试图构建任何示例项目时仍然会遇到错误。这些是我在控制台中得到的错误:

16:10:33 **** Incremental Build of configuration Default for project OpenCV Sample - 15         puzzle ****
"C:\Dev\android-ndk-r9d\ndk-build.cmd" all 
Android NDK: WARNING: APP_PLATFORM android-9 is larger than android:minSdkVersion 8 in     ./AndroidManifest.xml    
C:/Dev/android-ndk-r9d/build/core/add-application.mk:187: *** Android NDK: Aborting...    .  Stop.
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk    

我在"问题"选项卡中看到了这个:

Description Resource    Path    Location    Type
The type java.lang.Object cannot be resolved. It is indirectly referenced from required     .class files    Video.java  /OpenCV Library - 2.4.9/src/org/opencv/video    line 1      Java Problem
The project cannot be built until build path errors are resolved    OpenCV Sample -     camera-calibration      Unknown Java Problem
Unable to resolve target 'android-14'   OpenCV Library - 2.4.9      Unknown     Android Target Problem
The project was not built since its build path is incomplete. Cannot find the class     file for java.lang.Object. Fix the build path then try building this project    OpenCV     Library - 2.4.9      Unknown Java Problem
Unable to resolve target 'android-11'   OpenCV Sample - face-detection          Unknown Android Target Problem
The container 'Android Dependencies' references non existing library 'C:DevOpenCV-    2.4.9-android-sdksdkjavabinopencv library - 2.4.9.jar'  OpenCV Sample - camera-    calibration      Build path  Build Path Problem
Invalid project path: Include path not found (sourcescxx-stlgnu-    libstdc++4.6libsarmeabi-v7ainclude). OpenCV Sample - face-detection          pathentry   Path Entry Problem
The project cannot be built until build path errors are resolved    OpenCV Sample -     face-detection      Unknown Java Problem
Invalid project path: Include path not found (sourcescxx-stlgnu-    libstdc++4.6include).  OpenCV Sample - face-detection      pathentry   Path Entry     Problem
Program "ndk-build.cmd" not found in PATH  OpenCV Sample - face-detection              C/C++ Problem
Unable to resolve target 'android-11'   OpenCV Sample - 15 puzzle           Unknown Android Target Problem
The container 'Android Dependencies' references non existing library 'C:DevOpenCV-    2.4.9-android-sdksdkjavabinopencv library - 2.4.9.jar'  OpenCV Sample - 15 puzzle           Build path  Build Path Problem
The container 'Android Dependencies' references non existing library 'C:DevOpenCV-    2.4.9-android-sdksdkjavabinopencv library - 2.4.9.jar'  OpenCV Sample - face-    detection      Build path  Build Path Problem
Unable to resolve target 'android-11'   OpenCV Sample - camera-calibration          Unknown Android Target Problem
Invalid project path: Include path not found (platformsandroid-9arch-    armusrinclude).   OpenCV Sample - face-detection      pathentry   Path Entry     Problem
The project cannot be built until build path errors are resolved    OpenCV Sample - 15     puzzle       Unknown Java Problem
*** Android NDK: Aborting...    .  Stop.    OpenCV Sample - 15 puzzle         line 187, external location: C:Devandroid-ndk-r9dbuildcoreadd-application.mk   C/C++ Problem

我哪里错了?我的C/c++构建命令是:${NDKROOT}ndk-build。cmd和我有环境变量正确定义与包含ndk-build的文件夹的完整路径。cmd文件。如果还有其他需要我提供的信息,请告诉我。任何帮助将是非常感激的-这已经打败了我整整一个星期了!

也许你可以在http://johnhany.net/2014/04/using-opencv-on-android/找到一些会议。点击C/c++和符号->包括通用->路径,在GNU c++中添加如下路径:

            ${NDKROOT}/platforms/android-15/arch-arm/usr/include
            ${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include
            ${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include

在我的NDK r12b中没有4.6路径