1. 程式人生 > >字元轉碼開源庫libiconv目前還不支援64位

字元轉碼開源庫libiconv目前還不支援64位

最新版的libiconv 1.14目前還不支援64位系統,只能編譯出32位庫。

libiconv 1.14下載地址:

libiconv介紹:

linux系統編譯安裝方法:

$ ./configure --prefix=/usr/local
$ make
$ make install
執行make會報錯:

./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function)
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 ^
make[2]: *** [progname.o] 錯誤 1
make[2]:正在離開目錄 `/home/min/projects/libiconv-1.14/srclib'
make[1]: *** [all] 錯誤 2
make[1]:正在離開目錄 `/home/min/projects/libiconv-1.14/srclib'
make: *** [all] 錯誤 2


修改後make可以通過,但執行make install還是會報錯:

/usr/bin/install: cannot create regular file '/usr/local/lib/libcharset.so.1.0.0': Permission denied
make[2]: *** [install] 錯誤 1
make[2]:正在離開目錄 `/home/min/projects/libiconv-1.14/libcharset/lib'
make[1]: *** [install] 錯誤 2
make[1]:正在離開目錄 `/home/min/projects/libiconv-1.14/libcharset'
make: *** [install] 錯誤 2


提示許可權拒絕,需要用管理員許可權安裝,先執行su或者直接用sudo make install安裝。

--------------------------------

Android NDK編譯iconv,參考:ndk編譯iconv

編譯出來的是32位的,64的無法編譯成功。

NDK目錄下的編譯mk檔案也只是編譯了32位庫,Android.mk檔案位於:android-ndk-r10e/sources/android/support

內容如下,iconv.c檔案只再32位庫中編譯

LOCAL_PATH := $(call my-dir)

android_support_c_includes := $(LOCAL_PATH)/include

ifneq ($(filter $(NDK_KNOWN_DEVICE_ABI64S),$(TARGET_ARCH_ABI)),)
# 64-bit ABIs
android_support_sources := \
    src/musl-locale/catclose.c \
    src/musl-locale/catgets.c \
    src/musl-locale/catopen.c

else
# 32-bit ABIs

android_support_sources := \
    src/libdl_support.c \
    src/locale_support.c \
    src/math_support.c \
    src/stdlib_support.c \
    src/wchar_support.c \
    src/locale/duplocale.c \
    src/locale/freelocale.c \
    src/locale/localeconv.c \
    src/locale/newlocale.c \
    src/locale/uselocale.c \
    src/stdio/stdio_impl.c \
    src/stdio/strtod.c \
    src/stdio/vfprintf.c \
    src/stdio/vfwprintf.c \
    src/msun/e_log2.c \
    src/msun/e_log2f.c \
    src/msun/s_nan.c \
    src/musl-ctype/iswalnum.c \
    src/musl-ctype/iswalpha.c \
    src/musl-ctype/iswblank.c \
    src/musl-ctype/iswcntrl.c \
    src/musl-ctype/iswctype.c \
    src/musl-ctype/iswdigit.c \
    src/musl-ctype/iswgraph.c \
    src/musl-ctype/iswlower.c \
    src/musl-ctype/iswprint.c \
    src/musl-ctype/iswpunct.c \
    src/musl-ctype/iswspace.c \
    src/musl-ctype/iswupper.c \
    src/musl-ctype/iswxdigit.c \
    src/musl-ctype/towctrans.c \
    src/musl-ctype/wcswidth.c \
    src/musl-ctype/wctrans.c \
    src/musl-ctype/wcwidth.c \
    src/musl-locale/catclose.c \
    src/musl-locale/catgets.c \
    src/musl-locale/catopen.c \
    src/musl-locale/iconv.c \


    src/musl-locale/intl.c \