我正在尝试交叉编译libcurl for ARMv7(Android),但似乎无法编译它。
我有一个独立的工具链和CC已经设置的SDK和NDK。尽管设置了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.8checking 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将不起作用。这不是重点。谁能告诉我我哪里做错了。
发布于 2015-12-25 09:07:45
我为ARMv7编写了一个ftp类,而不是交叉编译libcurl。结束这一切。
https://stackoverflow.com/questions/34458820
复制相似问题