使用Android独立工具链构建cURL

时间:2012-01-25 19:10:35

标签: android curl android-ndk makefile

我正在尝试使用Android NDK独立工具链构建cURL,但我收到此错误:

tool_cb_hdr.o: In function `tool_header_cb':
tool_cb_hdr.c:(.text+0x1cc): undefined reference to `__mb_sb_limit'
tool_cb_hdr.c:(.text+0x1d0): undefined reference to `_CurrentRuneLocale'
tool_formparse.o: In function `formparse':
tool_formparse.c:(.text+0x3ec): undefined reference to `__mb_sb_limit'
tool_formparse.c:(.text+0x3f0): undefined reference to `_CurrentRuneLocale'
tool_getparam.o: In function `getparameter':
tool_getparam.c:(.text+0x171c): undefined reference to `_DefaultRuneLocale'
tool_msgs.o: In function `warnf':
tool_msgs.c:(.text+0x110): undefined reference to `_CurrentRuneLocale'
tool_msgs.c:(.text+0x118): undefined reference to `__mb_sb_limit'
tool_paramhlp.o: In function `proto2num':
tool_paramhlp.c:(.text+0x320): undefined reference to `__mb_sb_limit'
tool_paramhlp.c:(.text+0x324): undefined reference to `_CurrentRuneLocale'
tool_paramhlp.o: In function `str2num':
tool_paramhlp.c:(.text+0x388): undefined reference to `_DefaultRuneLocale'
tool_parsecfg.o: In function `parseconfig':
tool_parsecfg.c:(.text+0x3b4): undefined reference to `__mb_sb_limit'
tool_parsecfg.c:(.text+0x3b8): undefined reference to `_CurrentRuneLocale'
tool_urlglob.o: In function `glob_match_url':
tool_urlglob.c:(.text+0x23c): undefined reference to `_DefaultRuneLocale'
t    ool_urlglob.o: In function `glob_word':
tool_urlglob.c:(.text+0xb30): undefined reference to `__mb_sb_limit'
tool_urlglob.c:(.text+0xb34): undefined reference to `_CurrentRuneLocale'
tool_urlglob.c:(.text+0xb40): undefined reference to `_DefaultRuneLocale'
collect2: ld returned 1 exit status

这是我的环境:

export HOSTCONF=arm-eabi-linux
export NDK=$HOME/android/android-ndk-r5-crystax-2
export TOOLCHAIN=$HOME/android/toolchain
export ARCH=armv7-a
export SYSROOT=$TOOLCHAIN/sysroot
export PATH=$PATH:$TOOLCHAIN/bin:$SYSROOT/usr/local/bin
export CROSS_COMPILE=arm-linux-androideabi
export CC=${CROSS_COMPILE}-gcc
export CXX=${CROSS_COMPILE}-g++
export AR=${CROSS_COMPILE}-ar
export AS=${CROSS_COMPILE}-as
export LD=${CROSS_COMPILE}-ld
export RANLIB=${CROSS_COMPILE}-ranlib
export NM=${CROSS_COMPILE}-nm
export CFLAGS="-DANDROID -mandroid -fomit-frame-pointer --sysroot $SYSROOT -march=$ARCH -mfloat-abi=softfp -mfpu=vfp -mthumb"
export CXXFLAGS="$CFLAGS"
export LDLIBS="${NDK}/sources/crystax/libs/armeabi-v7a -lcrystax_static"

问题可能是什么?

我一直在尝试找到现有的cURL端口到Android,但它们似乎都使用ndk-build(而不是独立的工具链)或依赖于API的不稳定部分。

谢谢。

1 个答案:

答案 0 :(得分:0)

我做完之后能够建立:

export LDFLAGS="-L${NDK}/sources/crystax/libs/armeabi-v7a -lcrystax"