How to resolve "langinfo.h not found" error when building libiconv on OSX for Android?

4.7k Views Asked by At

I try to build libiconv as an bibliothek accessible by an android-JNI.

I've found a lot of example makefiles to include in my Android.mk. The problem is, every time I run ndk-build I get the following error:

libiconv/libcharset/lib/localcharset.c:51:24: fatal error: langinfo.h: No such file or directory

I called ./configure in the libiconv-folder but I still can't find a langinfo.h inside of this folder.

I am working on Mac OSX Mountain Lion. Does anybody know what to do?

UPDATE: There is a langinfo.hin /usr/include

4

There are 4 best solutions below

1
On

<langinfo.h> is not part of Android NDK.

The <langinfo.h> header contains the constants used to identify items of langinfo data. You can safely copy your system header from /usr/include to your project's include directory to resolve the compilation error.

Note however that this could be only the first symptom. Android does not contain langinfo-compatible data at all, and provides completely different localization tools.

0
On

I got the same situation while I build the xbmc for android. I just made a empty file "langinfo.h" in include directory. And works well.

0
On

You should be able to find langinfo.h under NDK_DIR/sources/android/support/include. Make sure to include this into your include path.

0
On

Try this

Modify libiconv/libcharset/config.h

comment this line 「#define HAVE_LANGINFO_CODESET 1」

then ndk-build again

enter image description here