我正在使用Android开发OpenCV。我尝试运行人脸检测示例。但是我总是遇到同样的错误,请帮忙。
构建命令失败。执行过程时出错 C:\ Users \ Cevdet \ AppData \ Local \ Android \ Sdk \ ndk-bundle \ ndk-build.cmd 带有参数{NDK_PROJECT_PATH = null APP_BUILD_SCRIPT = C:\ Users \ Cevdet \ AndroidStudioProjects \人脸检测\ openCVSamplefacedetection \ src \ main \ jni \ Android.mk NDK_APPLICATION_MK = C:\ Users \ Cevdet \ AndroidStudioProjects \ face-detection \ openCVSamplefacedetection \ src \ main \ jni \ Application.mk APP_ABI = armeabi-v7a NDK_ALL_ABIS = armeabi-v7a NDK_DEBUG = 1 APP_PLATFORM = android-16 NDK_OUT = C:/用户/ Cevdet / AndroidStudioProjects / face-detection / openCVSamplefacedetection / build / intermediates / ndkBuild / debug / obj NDK_LIBS_OUT = C:\ Users \ Cevdet \ AndroidStudioProjects \ face-detection \ openCVSamplefacedetection \ build \ intermediates \ ndkBuild \ debug \ lib C:/Users/Cevdet/AndroidStudioProjects/face-detection/openCVSamplefacedetection/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/libdetection_based_tracker.so} [armeabi-v7a]共享库:libdetection_based_tracker.so C:/Users/Cevdet/AndroidStudioProjects/face-detection/openCVSamplefacedetection/src/main/jni/DetectionBasedTracker_jni.cpp:34: 错误:未定义引用 'DetectionBasedTracker :: DetectionBasedTracker(std :: __ ndk1 :: basic_string,std :: __ ndk1 :: allocator> const&, DetectionBasedTracker :: Parameters const&)'clang ++。exe:错误:链接器 命令失败,退出代码为1(使用-v查看调用)make:*** [C:/Users/Cevdet/AndroidStudioProjects/face-detection/openCVSamplefacedetection/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/libdetection_based_tracker.so] 错误1
答案 0 :(得分:0)
您需要为您的项目设置OpenCV库。
您可以按照此处的说明进行操作-> https://stackoverflow.com/a/22427267/5773037