Android NDK C++ 'wstring' support

人走茶凉 提交于 2019-12-21 04:27:11

问题


I have source code/lib written in C++ - now i would like to compile and use the same in Android NDK project (NDK 6). I am able to compile most of the C++ files except "std::wstring" based functionality.

In Application.mk when i specify APP_STL: = stlport_static then it compiles std::wstring based code but when i specify APP_STL: = gnustl_static it fails to compile. I do not know how to resolve std::wstring related issue with APP_STL: = gnustl_static

Any pointer or help on this would be greatly appreciated.


回答1:


A very similar question has already been asked: android-ndk gnustl_static exe not working consider looking at that question and testing to see if any of those answers work.




回答2:


When I hit this exact problem, I saw the general disdain for wchar_t and decided to stop using it. So std::wstring became std::basic_string<uint_32>. I also had to rework some wide character string literals. It's not an ideal solution but it does address all future portability concerns.



来源:https://stackoverflow.com/questions/7696704/android-ndk-c-wstring-support

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!