Build shared for Android libc++ fails

asked 2016-04-29 16:06:48 -0600

I'm did a clone from https://github.com/Itseez/opencv.git @ commit 6e5e5d87df4212b91839704ff153ec6d8f2549f6

I used this cmake command:

cmake \
-DBUILD_SHARED_LIBS=YES \
-DANDROID_ABI=arm64-v8a \
-DBUILD_ANDROID_EXAMPLES=OFF \
-DINSTALL_PYTHON_EXAMPLES=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_TESTS=OFF \
-DANDROID_NATIVE_API_LEVEL=android-14 \
-DANDROID_STL=c++_shared \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DANDROID_STL_FORCE_FEATURES=ON \
-DCMAKE_TOOLCHAIN_FILE=../../opencv/platforms/android/android.toolchain.cmake $@ ../../opencv

The third party libraries built ok. I got c++ standard library link errors when linking opencv_core:

CMakeFiles/opencv_core.dir/src/command_line_parser.cpp.o: In function `std::string::_Rep::_M_dispose(std::allocator<char> const&) [clone .part.1]':
command_line_parser.cpp:(.text.unlikely._ZNSs4_Rep10_M_disposeERKSaIcE.part.1+0x38): undefined reference to `std::string::_Rep::_M_destroy(std::allocator<char> const&)'
CMakeFiles/opencv_core.dir/src/command_line_parser.cpp.o: In function `cv::from_str(cv::String const&, int, void*)':
command_line_parser.cpp:(.text._ZN2cvL8from_strERKNS_6StringEiPv+0x44): undefined reference to `VTT for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
command_line_parser.cpp:(.text._ZN2cvL8from_strERKNS_6StringEiPv+0x48): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
command_line_parser.cpp:(.text._ZN2cvL8from_strERKNS_6StringEiPv+0x50): undefined reference to `std::ios_base::ios_base()'

etc.

edit retag flag offensive close merge delete