这似乎是一个老问题,修复是安装32位C库和gcc multilibrary。我已经完成了在线不同帖子中建议的所有内容,但我仍然遇到了问题。我运行64位14.10又名Utopic,我正在尝试使用arm工具链。我的目标是验证我可以编译一个像hello.c这样的简单程序,然后继续使用更复杂的程序来使用该库。这是我收到的错误消息:
cd /home/sansari/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin
sansari@ubuntu:~/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin$ !1996
./arm-linux-androideabi-gcc --verbose -o hello -c hello.c
Using built-in specs.
COLLECT_GCC=./arm-linux-androideabi-gcc
Target: arm-linux-androideabi
Configured with: /s/ndk-toolchain/src/build/../gcc/gcc-4.9/configure --prefix=/tmp/ndk-andrewhsieh/build/toolchain/prefix --target=arm-linux-androideabi --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-mpfr=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-mpc=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-cloog=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-isl=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-ppl=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --disable-ppl-version-check --disable-cloog-version-check --disable-isl-version-check --enable-cloog-backend=isl --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --disable-libitm --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --enable-initfini-array --disable-nls --prefix=/tmp/ndk-andrewhsieh/build/toolchain/prefix --with-sysroot=/tmp/ndk-andrewhsieh/build/toolchain/prefix/sysroot --with-binutils-version=2.24 --with-mpfr-version=3.1.1 --with-mpc-version=1.0.1 --with-gmp-version=5.0.5 --with-gcc-version=4.9 --with-gdb-version=7.6 --with-python=/usr/local/google/home/andrewhsieh/mydroid/ndk/prebuilt/linux-x86_64/bin/python-config.sh --with-gxx-include-dir=/tmp/ndk-andrewhsieh/build/toolchain/prefix/include/c++/4.9 --with-bugurl=http://source.android.com/source/report-bugs.html --enable-languages=c,c++ --disable-bootstrap --enable-plugins --enable-libgomp --disable-libsanitizer --enable-gold --enable-graphite=yes --with-cloog-version=0.18.0 --with-isl-version=0.11.1 --enable-eh-frame-hdr-for-static --with-arch=armv5te --program-transform-name='s&^&arm-linux-androideabi-&' --enable-gold=default
Thread model: posix
gcc version 4.9 20140827 (prerelease) (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'hello' '-c' '-march=armv5te' '-mfloat-abi=soft' '-mfpu=vfp' '-mtls-dialect=gnu'
/home/sansari/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9/cc1 -quiet -v -iprefix /home/sansari/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/ hello.c -mbionic -fpic -quiet -dumpbase hello.c -march=armv5te -mfloat-abi=soft -mfpu=vfp -mtls-dialect=gnu -auxbase-strip hello -version -o /tmp/ccWTqx17.s
GNU C (GCC) version 4.9 20140827 (prerelease) (arm-linux-androideabi)
compiled by GNU C version 4.6.x-google 20120106 (prerelease), GMP version 5.0.5, MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/sansari/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/include"
ignoring duplicate directory "/home/sansari/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/../../lib/gcc/arm-linux-androideabi/4.9/include"
ignoring nonexistent directory "/tmp/ndk-andrewhsieh/build/toolchain/prefix/sysroot/usr/local/include"
ignoring duplicate directory "/home/sansari/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/../../lib/gcc/arm-linux-androideabi/4.9/include-fixed"
ignoring nonexistent directory "/home/sansari/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/../../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/include"
ignoring nonexistent directory "/tmp/ndk-andrewhsieh/build/toolchain/prefix/sysroot/usr/include"
#include "..." search starts here:
#include <...> search starts here:
/home/sansari/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/include
/home/sansari/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/include-fixed
End of search list.
GNU C (GCC) version 4.9 20140827 (prerelease) (arm-linux-androideabi)
compiled by GNU C version 4.6.x-google 20120106 (prerelease), GMP version 5.0.5, MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: d2d5f14f00a1381638660b109dec18f8
In file included from hello.c:3:0:
/usr/include/stdio.h:27:23: fatal error: features.h: No such file or directory
# include <features.h>
^
compilation terminated.
我尝试过在网上找到的所有可能的解决方案。比如安装libc6-dev-amd64,gcc-multilib,libc6-dev-i386。我也尝试重新安装其中一些,并使用aptitude。但我仍然得到这个错误。我该如何排除故障呢?