Linking errors on Android with OpenCV 3.4.0 and NDK

前端 未结 1 749
遥遥无期
遥遥无期 2021-01-06 07:24

I am trying to port existing computer vision code, written in C++ using OpenCV, to Android NDK. I successfully imported the OpenCV library version 3.4.0 (using the official

相关标签:
1条回答
  • 2021-01-06 08:04

    Recently, NDK switched to libc++ as default STL, but OpenCV is built with gnustl.

    externalNativeBuild {
      cmake {
        arguments "-DANDROID_STL=gnustl_shared"
      }
    }
    

    for your library will fix that.

    Alternatively, you can rebuild OpenCV with c++_shared.

    Update: Good news! You can simply download OpenCV 4.0.1 and it will work smoothly with NDK r.18+.

    0 讨论(0)
提交回复
热议问题