问一个交叉编译环境的问题
晨与飞扬 2013-10-10 09:49:30 环境:ubuntu 12.04 lts 64位
android 源代码版本4.0.4
问题:
android 源代码prebuilt/linux-x86/toolchain目录下的交叉编译工具,
和在http://www.mentor.com/网站上下载的交叉编译工具(arm-2013.05-24-arm-none-linux-gnueabi.bin),
有什么区别?
写了一小程序。
#include <stdio.h>
int main()
{
printf("hello word\n");
return 0;
}
使用android的交叉编译工具结果如下:
themitec@themitec-945GZM-S2:~/cpp$ arm-eabi-gcc -o he hellow.c
hellow.c:1:19: error: stdio.h: No such file or directory
hellow.c: In function 'main':
hellow.c:5: warning: incompatible implicit declaration of built-in function 'printf'
使用下载的交叉编译工具,就正常给编译通过。放到开发板上运行正常。
themitec@themitec-945GZM-S2:~/cpp$ arm-none-linux-gnueabi-gcc -static -o hellow hellow.c
themitec@themitec-945GZM-S2:~/cpp$ ll
总用量 652
drwxrwxr-x 2 themitec themitec 4096 10月 10 09:43 ./
drwxr-xr-x 33 themitec themitec 4096 10月 10 09:28 ../
-rwxrwxr-x 1 themitec themitec 654853 10月 10 09:43 hellow*
-rw-rw-r-- 1 themitec themitec 79 10月 9 17:14 hellow.c
themitec@themitec-945GZM-S2:~/cpp$
这是为什么呢?它们的区别是啥?高手不吝赐教。