New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error from STL library while compiling for Android with ANDROID_STL=c++_static(shared) #8742
Comments
What your toolchain compiler? clang/gcc? http://stackoverflow.com/questions/30541066/android-ndk-cwctype-and-string-build-errors 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 |
But headers are from this path:
so compiler should be clang. |
So is it true that currently for opencv you can only build with gcc although gcc has been deprecated in new ndk versions? |
BTW, Android NDK r15 has own CMake toolchain for Android - you could try to use it. |
the c++ headers are added in wrong order. See android/ndk#452 |
Any updates on this? I am getting this on API 14 with libc++ and NDK r16:
|
@alalek |
@feliwir any luck so far? I'm hitting the same issues trying to compile OpenCV version 3.2.0 with c++_static and NDKr16, using the NDK native CMake toolchain. |
Hi all, 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:
|
This works! Thank you very much! |
I have failed to compile opencv with NDK after setting ANDROID_STL to c++_static or c++_shared.
I have tried NDK r11 through r14, after fixing the NDK folder structuring problem, I still get errors while compiling any files that include STL headers such as . Error messages are like the following:
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.
The text was updated successfully, but these errors were encountered: