简体   繁体   中英

Building cURL with the Android standalone toolchain

I'm trying to build cURL using the Android NDK standalone toolchain, but I get this error:

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

This is my environment:

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"

What might the issue be?

I've been trying to find existing ports of cURL to Android but they all seem to use ndk-build (as opposed to the standalone toolchain) or rely on unstable parts of the API.

Thank you.

完成此操作后,我便可以构建:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM