错误,同时建立机器人NDK示例项目 [英] Error while building android ndk sample project
问题描述
你好,我是初学者开发NDK的应用程序。
hello i am beginner in developing ndk apps.
我要建立示例应用程序但我得到了以下错误在使用NDK-build命令编译本地code。
I was going to build sample application but i got following errors while Compiling the native code using the ndk-build command.
我使用的 UBUNTU OS。
nidhi@php-pc1:~/android-sdk-linux_x86/android-ndk-r7/samples/hello-jni$ /home/nidhi/android-sdk-linux_x86/android-ndk-r7/ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile thumb : hello-jni <= hello-jni.c
arm-linux-androideabi-gcc: error trying to exec 'cc1': execvp: No such file or directory
make: *** [obj/local/armeabi/objs-debug/hello-jni/hello-jni.o] Error 1
请帮我解决。
编辑:
我解决这个通过设置PATH
i solve this by set PATH
出口PATH = $ PATH:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2
export PATH=$PATH:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2
但新的错误发生。
`
android-sdk-linux_x86/android-ndk-r7/samples/hello-jni$ /home/nidhi/android-sdk-linux_x86/android-ndk-r7/ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile thumb : hello-jni <= hello-jni.c
cc1: error: unrecognized command line option "-mbionic"
cc1: error: unrecognized command line option "-mthumb"
cc1: error: unrecognized command line option "-mfpu=vfp"
jni/hello-jni.c:1:0: error: bad value (armv5te) for -march= switch
jni/hello-jni.c:1:0: error: bad value (xscale) for -mtune= switch
make: *** [obj/local/armeabi/objs-debug/hello-jni/hello-jni.o] Error 1
请帮助。
编辑:
它通过设置交叉编译PATH解决
it solve by set Cross complier PATH
出口CROSS_COMPILER = $ PATH:/家庭/尼迪/ Android的SDK-linux_x86 / Android的NDK-R7 / prebuilt / Linux的的x86 /斌/
export CROSS_COMPILER=$PATH:/home/nidhi/android-sdk-linux_x86/android-ndk-r7/prebuilt/linux-x86/bin/
推荐答案
它通过设置交叉编译PATH解决
it solve by set Cross complier PATH
出口CROSS_COMPILER = $ PATH:/家庭/尼迪/ Android的SDK-linux_x86 / Android的NDK-R7 / prebuilt / Linux的的x86 /斌/
export CROSS_COMPILER=$PATH:/home/nidhi/android-sdk-linux_x86/android-ndk-r7/prebuilt/linux-x86/bin/
这篇关于错误,同时建立机器人NDK示例项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!