Fatal error: iconv.h: No such file or directory

2,545 views
Skip to first unread message

hh.h...@gmail.com

unread,
Jul 26, 2013, 4:30:44 AM7/26/13
to spatiali...@googlegroups.com
jni/./libspatialite-amalgamation-3.0.1/spatialite.c:88:19: fatal error: iconv.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi-v7a/objs-debug/spatialite/./libspatialite-amalgamation-3.0.1/spatialite.o] Error 1
(caused by ndk-build.cmd the the Android application)

I have two libraries libspatialite-amalgamation-3.0.1 and libiconv-1.14, they are on the same folder. I built libiconv successfully but it took iconv.h: No such file or directory errors when buidling libspatialite with these details:
- OS: WinXP.
- Console: MinGW
- Commands:
./configure --target=mingw32 --disable-freexl --disable-geos --disable-proj
make
make install-strip

Then I added two statements at the top of those:
export "CFLAGS=-I/usr/local/include"
export "LDFLAGS=-L/usr/local/lib"
It showed warnings but built OK

Now I include them into my Android app and use ndk-build.cmd NDK_DEBUG=1 option to build this app, but it caused that error again.
As I know, the spatialite.c file includes a header named iconv.h, and it couldn't find the header file in the same folder or some environment folder, that's why it caused this error.
Please help me to solve this issue. What do "CFLAGS=-I/usr/local/include""LDFLAGS=-L/usr/local/lib" mean and how to set an argument pointing to the location of iconv.h? Or is there any better solution?

Thanks very much.

a.fu...@lqt.it

unread,
Jul 26, 2013, 6:02:24 AM7/26/13
to spatiali...@googlegroups.com
> Please help me to solve this issue. What do
> "CFLAGS=-I/USR/LOCAL/INCLUDE", "LDFLAGS=-L/USR/LOCAL/LIB" mean and
> how
> to set an argument pointing to the location of ICONV.H?
>

any version of the GCC C compiler will understand these environment
variables as follow:

CFLAGS=-I<pathname>
-------------------
this is the path of some directory where header files have to be
searched; you can define more than a single location, e.g.
-I/usr/local/include -I. -I../headers
this meaning:
a) search into /usr/local/include
b) if not found, then search into the current dir (.)
c) if still not found, then try ../headers


LDFLAGS=-L<pathname>
--------------------
exactly the same as above, this time intending the location(s)
where you intend the linker will search any required library

PLEASE NOTE: on any serious operating system pathnames are
always case-sensitive ... so (e.g. on Linux) /usr/local/include
is a valid path, but /USR/LOCAL/INCLUDE doesn't exist

bye Sandro

--
Il messaggio e' stato analizzato alla ricerca di virus o
contenuti pericolosi da MailScanner, ed e'
risultato non infetto.

hh.h...@gmail.com

unread,
Jul 30, 2013, 3:52:41 AM7/30/13
to spatiali...@googlegroups.com
@sandro furieri 
Thanks for your support
Reply all
Reply to author
Forward
0 new messages