OpenCV for android sample programs showing error

前端 未结 2 1931
旧巷少年郎
旧巷少年郎 2021-01-01 01:38

I have downloaded OpenCV project for android and the sample projects that came bundled with it contains several errors.... Only the projects that contain the NDK code has th

相关标签:
2条回答
  • 2021-01-01 02:29

    @Nolan's answer followed by @Michael's comment solved it for me. Here are the combined steps:

    1. In Eclipse, right click on your project and select properties (This is on a mac btw)
    2. Expand C/C++ General
    3. Select Paths and Symbols
    4. Under Languages select GNU C++
    5. The following includes should be defined under Include directories

      ${NDKROOT}/platforms/android-9/arch-arm/usr/include
      ${ProjDirPath}/../../sdk/native/jni/include
      ${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi-v7a/include
      ${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.4.3/include
      
    6. Make sure ${NDKROOT} is defined as an environment variable. If it's not go ahead and add it under C/C++ Build - Environment

    7. Now go ahead and rebuild the index by right clicking on your project and select Index - Rebuild

    Cheers.

    0 讨论(0)
  • 2021-01-01 02:31

    I had the same problem and was able to resolve these and other errors encountered while following the OpenCV tutorial by using the following include paths:

    ${NDKROOT}/platforms/android-9/arch-arm/usr/include
    ${ProjDirPath}/../../sdk/native/jni/include
    ${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi-v7a/include
    ${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.4.3/include
    
    0 讨论(0)
提交回复
热议问题