NDK Clang error: undefined reference to 'localeconv'
The answer is - NDK version for SDK 19 doesn't implement the whole C++11 standard in the STL. locale.h
header has stubs for localeconv()
method, but the library doesn't implement it.The closest Android SDK that implement localeconv()
is SDK 21.This is implicitly stated in the header <locale.h>
struct lconv* localeconv(void) __INTRODUCED_IN(21) __VERSIONER_NO_GUARD;
#if __ANDROID_API__ >= 21
locale_t duplocale(locale_t) __INTRODUCED_IN(21);
void freelocale(locale_t) __INTRODUCED_IN(21);
locale_t newlocale(int, const char*, locale_t) __INTRODUCED_IN(21);
#endif /* __ANDROID_API__ >= 21 */
char* setlocale(int, const char*);
#if __ANDROID_API__ >= 21
locale_t uselocale(locale_t) __INTRODUCED_IN(21);
#endif /* __ANDROID_API__ >= 21 */
#define LC_GLOBAL_LOCALE __BIONIC_CAST(reinterpret_cast, locale_t, -1L)
__END_DECLS
#endif /* _LOCALE_H_ */