我正在尝试为ARMv7(Android)交叉编译libcurl,我似乎无法编译它。
我有SDK和NDK,独立的工具链和CC已经设置好了。虽然设置CC时会破坏编译器。
例如,我的工具链在我的bashrc中设置如下:
export NDK=/home/anthony/android-ndk-r9b
export SYSROOT=$NDK/platforms/android-16/arch-arm
export CC="$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc-4.8 --sysroot=$SYSROOT"
如果我取消注释CC,我在尝试CC libcurl时收到错误:
curl-7.46.0 $ ./configure$ prefix=/home/anthony/Documents/Ruby/androidSMS/Curl/curl-7.46.0/lib/curl
--build=i686-pc-linux-gnu --host=arm-linux-gnueabi
--target=arm-linux
CC=/home/anthony/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc-4.8
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking whether to disable dependency on -lrt... (assumed no)
checking for path separator... :
checking for sed... /bin/sed
checking for grep... /bin/grep
checking for egrep... /bin/grep -E
checking for arm-linux-gnueabi-ar... /usr/bin/arm-linux-gnueabi-ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for arm-linux-gnueabi-gcc... /home/anthony/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc-4.8
checking whether the C compiler works... no
configure: error: in `/home/anthony/Documents/Ruby/androidSMS/Curl/curl-7.46.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
在评论CC后我必须打开一个新的终端。取消设置CC将无法正常工作。多数民众赞成。有人可以告诉我我做错了什么。
答案 0 :(得分:1)
我编写了一个ftp类而不是为ARMv7交叉编译libcurl。关闭它。