Hi, I have just started using android ndk recently and was able to
build and compile some c++ files before. Now, on another project, I
have a problem with this error: "undefined reference to libiconv_open,
libiconv, libiconv_close". I'm really confused on how to use libiconv
for android-ndk, as in I have no idea how to start. I tried searching
the web but there is no tutorial on how to do it for starters, so I
tried downloading libiconv1.13.1 and placing it in my project's jni
folder and tried to build it but an error occurred:
$ /cygdrive/c/android-ndk-r7b/ndk-build -B
Cygwin : Generating dependency file converter script
Compile thumb : iconv <= iconv.c
jni/libiconv-1.13.1/lib/iconv.c:21:19: error: iconv.h: No such file or
directory
jni/libiconv-1.13.1/lib/iconv.c:25:20: error: config.h: No such file
or directory
jni/libiconv-1.13.1/lib/iconv.c:26:26: error: localcharset.h: No such
file or directory
...
I checked in the libiconv folder and found
iconv.h.in, I tried to
rename the file to iconv.h but another error occurred:
jni/libiconv-1.13.1/include/iconv.h:25: error: stray '@' in program
jni/libiconv-1.13.1/include/iconv.h:25: error: stray '@' in program
jni/libiconv-1.13.1/include/iconv.h:25: error: expected '=', ',', ';',
'asm' or '__attribute__' before 'int'
In file included from jni/libiconv-1.13.1/lib/iconv.c:21:
jni/libiconv-1.13.1/include/iconv.h:83: error: stray '@' in program
jni/libiconv-1.13.1/include/iconv.h:83: error: expected declaration
specifiers or '...' before 'ICONV_CONST'
jni/libiconv-1.13.1/include/iconv.h:83: error: stray '@' in program
...
I've been googling for some help for 3 days and still found nothing.
Do I have to do something after downloading libiconv before trying to
use it in my ndk project? like installing? or configuring something?
Please tell me what to do, step by step if its ok. Thanks.