android opencv 环境问题-- unresolved inclusion

刚才碰到了问题特别奇葩。。。 所有jni文件下面的cpp文件下的外部引入库都无法使用,


详细错误见图片android opencv 环境问题-- unresolved inclusion_第1张图片



于是乎一顿百度,但是都得不到好的结果

最后还是根据官网上的方法,最终成功编译

原文地址http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/android_dev_intro.html


具体步骤:

在工程(此处是Opencv tutorial4)下右键-->Project Properties -> C/C++ General -> Paths and Symbols

加上如下图的几个目录

当然如果你的NDK是 r8或者之前的,这么加

# for NDK r8 and prior:
${NDKROOT}/platforms/android-9/arch-arm/usr/include
${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include
${NDKROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include
${ProjDirPath}/../../sdk/native/jni/include
如果NDK是 r8 或者之后的,这么加

# for NDK r8b and later:
${NDKROOT}/platforms/android-9/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
${ProjDirPath}/../../sdk/native/jni/include

最后一个是OpenCV4Android SDK的位置


android opencv 环境问题-- unresolved inclusion_第2张图片


之后等待编译就大功告成了~~~




你可能感兴趣的:(android,bug,opencv)