https://groups.google.com/forum/?fromgroups=#!topic/android-ndk/M5XedQm0bvQ
+++++ 问题
Hi everyone,
I am trying to cross compile the GNU libiconv-1.13.1 library using the
Android standalone toolchain. I am using Android level 8 for this.
After copying the latest config.guess and config.sub scripts from the
GNU auto tools website I was able to configure the library.
I get a compile error when I do a make. The complier error is as
follows:
make[5]: Leaving directory `/data/proto/distro/commonc++/
0.6.4-dti.3x/libiconv-1.13.1'
/data/android-8-toolchain/bin/
DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib -I../intl -
DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -mthumb -g -DANDROID -
c areadlink.c
In file included from /data/android-8-toolchain/bin/
include/sys/time.h:33,
from /data/android-8-toolchain/bin/
include/time.h:32,
from /data/android-8-toolchain/bin/
include/wchar.h:39,
from ./stdint.h:483,
from /data/android-8-toolchain/bin/
linux-androideabi/4.4.3/
from areadlink.c:30:
/data/android-8-toolchain/bin/
error: expected specifier-qualifier-list before 'time_t'
/data/android-8-toolchain/bin/
error: expected specifier-qualifier-list before 'time_t'
It seems like time_t is not defined in the standalone toolchain's
header files. Does anyone have any idea if there is a fix or
workaround for this? Thanks.
Dominique
+++++解决方法
I just hit this too. It looks like libiconv uses gnulib which will
create a fallback stdint.h under the srclib/ directory during ./
configure. That fallback header then wreaks havoc because the android
toolchain itself provides headers that expect to include stdint.h and
they are being forced to include the one generated during ./configure
resulting in a circular dependency and sys/types.h doesn't get
included with the time_t typedef.
After delving a bit into the sysm4/stdinc.m4 file I luckily found it's
possible to override the gnulib macro so it never writes out a
fallback stdint.h if you set gl_cv_header_working_stdint_h=
So my full configure line is now:
gl_cv_header_working_stdint_h=
androideabi
That seems to get things building for me with libiconv-1.14
I hope that helps,
regards,
- Robert
相关热门文章
给主人留下些什么吧!~~
评论热议