error: ../include/wchar.h: No such file or directory

my ndk version is android-ndk-r5-crystax-1.beta3;
and use cocos2d-0.99.5-x-0.8.3 create a project named cocos2dTest;
here is the compile error info,who can help me?

In file included from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:48,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_iosfwd.h:22,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_string_fwd.h:23,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_string.h:27,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/string:29,
from C:/android/cocos2d-0.99.5-x-0.8.3/cocos2dTest/android/jni/…/…/…/cocos2dx/CCConfiguration.h:30,
from C:/android/cocos2d-0.99.5-x-0.8.3/cocos2dTest/android/jni/…/…/…/cocos2dx/CCConfiguration.cpp:26:
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:68:46: error: …/include/wchar.h: No such file or directory
In file included from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:48,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_iosfwd.h:22,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_string_fwd.h:23,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_string.h:27,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/string:29,
from C:/android/cocos2d-0.99.5-x-0.8.3/cocos2dTest/android/jni/…/…/…/cocos2dx/CCConfiguration.h:30,
from C:/android/cocos2d-0.99.5-x-0.8.3/cocos2dTest/android/jni/…/…/…/cocos2dx/CCConfiguration.cpp:26:
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:178: error: ‘::wint_t’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:187: error: ‘::mbstate_t’ has not been declared
In file included from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:48,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_iosfwd.h:22,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_string_fwd.h:23,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_string.h:27,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/string:29,
from C:/android/cocos2d-0.99.5-x-0.8.3/cocos2dTest/android/jni/…/…/…/cocos2dx/CCConfiguration.h:30,
from C:/android/cocos2d-0.99.5-x-0.8.3/cocos2dTest/android/jni/…/…/…/cocos2dx/CCConfiguration.cpp:26:
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:213: error: ‘::fgetwc’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:214: error: ‘::fgetws’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:215: error: ‘::fputwc’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:216: error: ‘::fputws’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:222: error: ‘::fwide’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:224: error: ‘::fwprintf’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:225: error: ‘::fwscanf’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:226: error: ‘::getwchar’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:231: error: ‘::getwc’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:233: error: ‘::ungetwc’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:235: error: ‘::putwc’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:237: error: ‘::putwchar’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:251: error: ‘::swprintf’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:252: error: ‘::vswprintf’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:254: error: ‘::swscanf’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:255: error: ‘::vfwprintf’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:256: error: ‘::vwprintf’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:261: error: ‘::wcsftime’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:263: error: ‘::wcstok’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:268: error: ‘::wcscoll’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:269: error: ‘::wcsxfrm’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:271: error: ‘::wcscat’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:272: error: ‘::wcsrchr’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:273: error: ‘::wcscmp’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:275: error: ‘::wcscpy’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:276: error: ‘::wcscspn’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:278: error: ‘::wcslen’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:279: error: ‘::wcsncat’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:280: error: ‘::wcsncmp’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:281: error: ‘::wcsncpy’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:282: error: ‘::wcspbrk’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:283: error: ‘::wcschr’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:285: error: ‘::wcsspn’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:288: error: ‘::wcstod’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:289: error: ‘::wcstol’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:293: error: ‘::wcsstr’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:294: error: ‘::wmemchr’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:298: error: ‘::wctob’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:301: error: ‘::wmemcmp’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:302: error: ‘::wmemmove’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:304: error: ‘::wprintf’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:305: error: ‘::wscanf’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:327: error: ‘::wmemcpy’ has not been declared
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_cwchar.h:328: error: ‘::wmemset’ has not been declared
In file included from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_iosfwd.h:22,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_string_fwd.h:23,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/_string.h:27,
from C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/string:29,
from C:/android/cocos2d-0.99.5-x-0.8.3/cocos2dTest/android/jni/…/…/…/cocos2dx/CCConfiguration.h:30,
from C:/android/cocos2d-0.99.5-x-0.8.3/cocos2dTest/android/jni/…/…/…/cocos2dx/CCConfiguration.cpp:26:
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:127: error: ‘mbstate_t’ was not declared in this scope
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:127: error: template argument 1 is invalid
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:127: error: invalid type in declaration before ‘;’ token
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:128: error: ‘mbstate_t’ was not declared in this scope
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:128: error: template argument 1 is invalid
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:128: error: invalid type in declaration before ‘;’ token
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:138: error: ‘mbstate_t’ does not name a type
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:217: error: ‘mbstate_t’ does not name a type
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:244: error: ‘wint_t’ was not declared in this scope
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:244: error: template argument 2 is invalid
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h: In static member function ‘static wchar_t* std::char_traits<wchar_t>::move(wchar_t**, const wchar_t**, size_t)’:
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:249: error: ‘wmemmove’ was not declared in this scope
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h: In static member function ‘static wchar_t* std::char_traits<wchar_t>::copy(wchar_t**, const wchar_t**, size_t)’:
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:253: error: ‘wmemcpy’ was not declared in this scope
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h: In static member function ‘static int std::char_traits<wchar_t>::compare(const wchar_t**, const wchar_t**, size_t)’:
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:257: error: ‘wmemcmp’ was not declared in this scope
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h: In static member function ’static wchar_t* std::char_traits<wchar_t>::assign(wchar_t**, size_t, wchar_t)‘:
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:261: error: ’wmemset’ was not declared in this scope
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h: In static member function ’static size_t std::char_traits<wchar_t>::length‘:
C:/android/android-ndk-r5-crystax-1.beta3/sources/cxx-stl/stlport/stlport/stl/char_traits.h:264: error: ’wcslen’ was not declared in this scope
make:**** [/cygdrive/C/android/cocos2d-0.99.5-x-0.8.3/cocos2dTest/android/obj/local/armeabi/objs-debug/cocos2d/CCConfiguration.o] Error 1

Use google official ndk r5, instead of r5-crystax version

give me a download link? tank you very much!

http://lmgtfy.com/?q=official+android+ndk+r5&l=1

:wink:

The Crystax version should also work though. I’m using it here with the mingw patch, so I don’t have to install Cygwin (I really don’t like Cygwin, it always seems to be messed up on my systems, never works without crashing).

Downloading from android official website is recommended http://developer.android.com/sdk/ndk/index.html

so you mean the error is caused by cygwin

By stl implementation.

Minggo Zhang wrote:

By stl implementation.

You also met the problem, Can share the solution?

I haven’t met the problem, I use ndk-r5 offered by google.
Juse like Walzer said, you should not use crystax version.

yeah! now it’s work ok with ndk-r5 offered by google, thank you