Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Error from STL library while compiling for Android with ANDROID_STL=c++_static(shared) #8742
I have failed to compile opencv with NDK after setting ANDROID_STL to c++_static or c++_shared.
and there're hundreds more of them. Have tried replacing the toolchain from NDK/build/cmake as well as standalone toolchain exported from NDK/build/tools/make-standalone-toolchain.sh, all efforts failed and resulted in the same error as above.
What your toolchain compiler? clang/gcc?
Usage questions should go to Users OpenCV Q/A forum: http://answers.opencv.org
Compiler was gcc.
I found an identical question on OpenCV Q&A forum at http://answers.opencv.org/question/118379/build-failure-with-android-ndk-r13b-and-c_shared/
Because there's no reply to the question, I posted an issue here. Sorry for the confusion.
The reason I can't switch to
I'm hitting the same issue, trying to compile OpenCV 3.4.1 or HEAD with c++_static and NDKr16.
I need C++11, so gnustl is not an option, and it appears to be impossible to set clang as the compiler.
This makes OpenCV not usable together with C++11 on Android, not to mention that gcc support is going to be discontinued in NDKr17 (coming very soon) and will be removed in NDKr18: https://github.com/android-ndk/ndk/wiki/Changelog-r17-beta2.
I could contribute some code, but I need some advice on where to start: the cmake files in OpenCV take thousands of lines of mostly undocumented code.
Android NDK provides own CMake toolchain file since r15. So solution is very simple - use it instead of custom OpenCV version (which leave for legacy NDKs).
Try something like this: