/host/android-ndk-r7/mytoolchain/bin/../sysroot/usr/include/wchar.h:35:
error: conflicting types for 'wchar_t'
/host/android-ndk-r7/mytoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include/stddef.h:323: note: previous declaration of 'wchar_t' was here
Android NDK Dev Guide(from NDK)
USING THE ANDROID TOOLCHAIN AS A STANDALONE COMPILER
5.2/ wchar_t support:
- - - - - - - - - - -
As documented, the Android platform did not really support wchar_t until
Android 2.3. What this means in practical terms is that:
- If you target platform android-9 or higher, the size of wchar_t is
4 bytes, and most wide-char functions are available in the C library
(with the exception of multi-byte encoding/decoding functions and
wsprintf/wsscanf).
- If you target any prior API level, the size of wchar_t will be 1 byte
and none of the wide-char functions will work anyway.
We recommend any developer to get rid of any dependencies on the wchar_t type
and switch to better representations. The support provided in Android is only
there to help you migrate existing code.
本文介绍了Android NDK中wchar_t类型的支持情况。针对不同API级别,wchar_t的大小及可用性有所不同。对于API级别9及以上,wchar_t大小为4字节,并提供了大部分宽字符函数;而对于更早的API级别,wchar_t大小为1字节且宽字符函数不可用。
357

被折叠的 条评论
为什么被折叠?



