I try to build a project based on two open source libraries. The libraries I am using are OpenCV and ceres. The libopencv_java3.so is the release OpenCV3.1.2 from the website github that include OpenCV-3.1.0-android-sdk. The libceres.so is compiled from souce code by myself.
When I build my application, NDK-build generates following information:
clang++.exe: warning: argument unused during compilation: '-nostdlib++' [-Wunused-command-line-argument]
error: undefined reference to 'cv::imwrite(cv::String const&, cv::_InputArray const&, std::__ndk1::vector > const&)'
After googling, I find one related post
Error Undefined reference to 'std::__ndk1::locale::~locale()' The answer says that different STL implementations are used.
For my case, libopencv_java.so may use gnustl_static and libceres uses c++_static. I don't understand the reason. The two implementations are both static libraries and conflict should not occur.
- Is all so files from opencv release compiled with gnustl_static?
- Why __ndk1 appears in std::vector?
- For one large project, different engineers take different sub-tasks. Should they link one common stl implementation? Is the requirement different for static linkage and dynamic linkage?