The GNU C library provides an implementation of iconv - how do I use it?
Simple program:
#include
int main( int argc, char **argv ) {
Your program seems fine and compiles fine on my system (Mandriva Linux 2010.1).
I find the libiconv_* references in your compile log worrisome, though. Are you sure that the iconv.h version that gets included comes from glibc and not from a separate libiconv implementation, such as GNU libiconv? It sounds as if it adds a lib prefix to all iconv functions to avoid symbol collisions with the iconv implementation of the C library that came with the system.
Having to explicitly link to libiconv points to a separate iconv implementation too - glibc does not need it.
EDIT:
For the record, I just verified that using the iconv.h header file from libiconv without explicitly linking against it will produce exactly the result that you are seeing - it renames all iconv functions by adding a lib prefix to their names.