How to install libiconv for android ndk?

Go To


Can somebody teach me or point me to a tutorial on how to install libiconv for android? I've been googling for 3 days and I can't find a tutorial or a how-to.

2012-04-04 02:07
by Coola
The Java library provides all the charset conversion services you might need. Just sayin'. Then again, if porting existing iconv-based code.. - Seva Alekseyev 2012-04-04 02:20
I think it would just be a matter of building it (from source) for Android. I doubt there is an Android-targetted version that you can just "install". Get the source, create an file to compile the source (look at the makefiles provided with libiconv so you know what files to compile) and ndk-build the sucker - Samuel 2012-04-04 02:54
Actually, I am trying to build and compile some c++ files in android ndk but an error occured "undefined reference to libiconvopen, libiconv and libiconvclose", which means some c++ files used iconv, that's why I want to install/compile libiconv to android-ndk so my files will build successfully. Can you suggest anything? or Am i going for a wrong solution regarding the errors - Coola 2012-04-04 02:58
@Coola It might be easier to just add libiconv to the project you're building instead of building it as a separate library. Still, check out the link in my answer. It gives you the things you'll need to add to your existing makefile, and it also reveals the necessary files that you'll need to add to your project - Samuel 2012-04-04 03:08
Ok, thanks Samuel, I'll see what I can d - Coola 2012-04-04 05:01


Grab the libiconv source, and make an makefile. Look at this site for a prewritten makefile for libiconv and Android. Once you have the file you can build using the ndk-build script.

2012-04-04 02:56
by Samuel


My guess is that you don't need iconv on Android. Android should be all UTF-8 everywhere, so there should be no need for character conversion. Maybe there are cases where you want your app to edit foreign files in all sorts of charsets, that's the only reason I can think of where an Android app would need iconv.

So instead of trying to include libiconv, perhaps you should just change whatever code you are using that requires libiconv so that it does not require it when running on Android.

2014-02-25 15:21
by Hans-Christoph Steiner
Granted, the question isn't well stated. Any time you are cross-compiling using the NDK, and that library that requires iconv you'll find yourself asking this question - Cameron Lowell Palmer 2017-01-02 22:47