大厦卷曲的Andr​​oid工具链独立卷曲、独立、大厦、工具

2023-09-07 11:22:46 作者:天空微晴

我试图建立使用Android NDK工具链独立卷曲,但我得到这个错误:

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

这是我的环境:

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?

我一直试图找到卷曲现有端口到Android,但他们似乎都使用NDK的构建(而不是独立的工具链),或依赖于API的不稳定地区。

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.

感谢您。

推荐答案

我是能够建立我这样做后:

I was able to build after I did this:

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