问题描述
背景
- OSX操作系统是
- R8 NDK
我想使用Android GCC编译器来编译下面的类...
的#include< stdint.h>
诠释主要(无效){
返回0;
}
我做用下面的命令......
取消@ UN:〜/开发/ code / $的OpenGL ~/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/darwin-x86/bin/arm-linux-androideabi-gcc -o的hello.c打招呼
我得到...
1:0 在文件从hello.c中包括:
/Users/un/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/include/stdint.h:3:26:致命错误:stdint.h:没有这样的文件或目录
编译终止。
所以,由于缺乏GCC的知识(但一些谷歌的能力),我觉得这和尝试...
取消@ UN:〜/开发/ code / $的OpenGL ~/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/darwin-x86/bin/arm-linux-androideabi-gcc hello.c的-o你好-ffreestanding
和我得到的...
<$p$p><$c$c>/Users/un/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:错误:无法打开crtbegin_dynamic.o:没有这样的文件或目录/Users/un/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:错误:无法打开crtend_android.o:没有这样的文件或目录
/Users/un/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:错误:无法找到-lc
/Users/un/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:错误:无法找到-ldl
collect2:劳工处返回1退出状态
有人可以帮助我什么,我做错了什么?我缺少一个链接或东西吗? Android.mk是不是一种选择。
更新这不工作要么...
ARM-Linux的androideabi-GCC的hello.c --sysroot =〜/开发/ Android版/ Android的NDK-R8C /平台/ Android的9 /弓臂
/Users/jackiegleason/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:错误:无法打开crtbegin_dynamic.o:没有这样的文件或目录
/Users/jackiegleason/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:错误:无法打开crtend_android.o:没有这样的文件或目录
/Users/jackiegleason/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:错误:无法找到-lc
/Users/jackiegleason/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:错误:无法找到-ldl
collect2:劳工处返回1退出状态
所以,因为我不希望使用Android.mk文件,我说干就干,创建一个独立的工具链。这是使用以下做...
/Users/un/Downloads/android-ndk-r8d/build/tools/make-standalone-toolchain.sh --platform = Android的9 --install-DIR = / TMP /我的工具链
的/ tmp /我的工具链/斌/ ARM-Linux的androideabi-GCC的hello.c
我想知道什么是另类,是在联系我能做的海湾合作委员会的条款。
Background
- OSX is OS
- R8 NDK
I am trying to compile the following class using the Android GCC compiler...
#include <stdint.h>
int main (void){
return 0;
}
I do the with the following command...
un@un:~/Development/Code/OpenGL$ ~/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/arm-linux-androideabi-gcc hello.c -o hello
I get...
In file included from hello.c:1:0:
/Users/un/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/include/stdint.h:3:26: fatal error: stdint.h: No such file or directory
compilation terminated.
So due to a lack of gcc knowledge (but some Google ability) I find this and try it...
un@un:~/Development/Code/OpenGL$ ~/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/arm-linux-androideabi-gcc hello.c -o hello -ffreestanding
and I get...
/Users/un/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory
/Users/un/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtend_android.o: No such file or directory
/Users/un/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lc
/Users/un/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldl
collect2: ld returned 1 exit status
Can someone help me with what I am doing wrong? Am I missing a link or something? Android.mk is not an option.
UPDATE this isn't working either...
arm-linux-androideabi-gcc hello.c --sysroot=~/Development/Android/android-ndk-r8c/platforms/android-9/arch-arm
/Users/jackiegleason/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory
/Users/jackiegleason/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtend_android.o: No such file or directory
/Users/jackiegleason/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lc
/Users/jackiegleason/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldl
collect2: ld returned 1 exit status
So, since I don't want to use Android.mk file, I went ahead and created a standalone toolchain. this is done using the following...
/Users/un/Downloads/android-ndk-r8d/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=/tmp/my-toolchain
/tmp/my-toolchain/bin/arm-linux-androideabi-gcc hello.c
I would like to know what the "alternative" is in terms of the gcc linking I could do.
这篇关于使用的问题编译对象手臂Linux的androideabi-GCC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!