【发布时间】:2019-03-12 09:07:36
【问题描述】:
我在android NDK下编写opencv时遇到很多未定义的引用错误,例如:
system.cpp:(.text.unlikely._ZNSs4_Rep10_M_disposeERKSaIcE.part.5+0x1c): 对`std::string::_Rep::_M_destroy(std::allocator) 的未定义引用 const&)'
G:/AndroidProjects/SprayingPrjJNI/app/src/main/cpp/../jniLibs/arm64-v8a/libopencv_core.a(system.cpp.o): 在函数 `void std::_Destroy(std::string*, std::string*, std::allocator&) [克隆 .isra.88]':
system.cpp:(.text.unlikely._ZSt8_DestroyIPSsSsEvT_S1_RSaIT0_E.isra.88+0x18): 对`std::string::_Rep::_S_empty_rep_storage'的未定义引用
system.cpp:(.text.unlikely._ZSt8_DestroyIPSsSsEvT_S1_RSaIT0_E.isra.88+0x2c): 对`std::string::_Rep::_S_empty_rep_storage'的未定义引用
........
我真的不知道如何解决这些错误,请帮助我,谢谢
【问题讨论】:
-
您好,该问题可能与您选择使用的 NDK 和 OpenCV 版本密切相关。请使用两者的版本信息更新您的问题。
-
您还可以查看 my recent answer,它提供了通过 NDK 使用 OpenCV 的简单开始。它针对 CMake 构建系统进行了调整,因此如果您更喜欢 ndk-build,请随时询问更多说明。
-
非常感谢您的cmets,NDK版本是19.1,openCV版本是3.4.5
标签: android opencv android-ndk