android - NDK 编码中 OpenCV 的未定义引用错误过多

标签 android opencv android-ndk

当我在 android NDK 下编写 opencv 时,我得到许多 undefined reference 错误,例如:

system.cpp:(.text.unlikely._ZNSs4_Rep10_M_disposeERKSaIcE.part.5+0x1c): undefined reference to `std::string::_Rep::_M_destroy(std::allocator const&)'

G:/AndroidProjects/SprayingPrjJNI/app/src/main/cpp/../jniLibs/arm64-v8a/libopencv_core.a(system.cpp.o): In function `void std::_Destroy(std::string*, std::string*, std::allocator&) [clone .isra.88]':

system.cpp:(.text.unlikely._ZSt8_DestroyIPSsSsEvT_S1_RSaIT0_E.isra.88+0x18): undefined reference to `std::string::_Rep::_S_empty_rep_storage'

system.cpp:(.text.unlikely._ZSt8_DestroyIPSsSsEvT_S1_RSaIT0_E.isra.88+0x2c): undefined reference to `std::string::_Rep::_S_empty_rep_storage'

..................

我真的不知道如何解决这些错误,请帮助我,谢谢

最佳答案

参见 NDK - problems after GNUSTL has been removed from the NDK (revision r18)

但是如果您没有非常充分的理由继续使用旧版本的 OpenCV,最简单的方法是 switch to prebuilt OpenCV 4.01与 NDK r19 兼容。

关于android - NDK 编码中 OpenCV 的未定义引用错误过多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55117666/

相关文章:

android - 在android中创建一个圆形 View

php - 我有一个连接到 phpmyadmin 的 laravel 网站,但现在我想将 android 应用程序连接到同一个数据库

java - 应用程序引擎预热请求不适用于端点

c++ - 访问 cv::Mat 数据的 OpenCV 错误

OpenCV cvLoadImage 函数不适用于显式路径

java - Visual Studio 构建配置的 Eclipse 等价物是什么?

java - Android OpenSL "pAudioSrc: data format 2 not allowed"- 拒绝 SL_DATAFORMAT_PCM?

android - 在Android中,使用exoplayer,如何用与设备不具有相同宽高比的视频填充surfaceview?

android - Jfloat 到 Float

c++ - 对于标题 "fcntl.h"中的这个错误,我应该修改什么?