主题 : 編譯unsafe for cross-compilation 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 66311
精华: 0
发帖: 2
金钱: 10 两
威望: 2 点
综合积分: 4 分
注册时间: 2012-03-28
最后登录: 2012-07-30
楼主  发表于: 2012-03-28 17:59

 編譯unsafe for cross-compilation

管理提醒: 本帖被 qq2440 从 micro2440技术交流专区 移动到本区(2013-11-18)
kevin@kevin-T60:/opt/FriendlyARM/mini2440/examples/hello$ make
arm-linux-gcc -o hello hello.c
cc1: warning: include location "/usr/include" is unsafe for cross-compilation
cc1: warning: include location "/usr/local/include" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/i386-linux-gnu" is unsafe for cross-compilation
kevin@kevin-T60:/opt/FriendlyARM/mini2440/examples/hello$


is unsafe for cross-compilation請問該怎麼解決?
我已經有在编辑/root/.bashrc 文件,在最后一行 export PATH=$PATH:/usr/local/arm/4.3.2/bin
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2012-03-28 21:19
通常“/usr/include”这样的路径是不能包含在交叉编译器的头文件搜索路径里的。检查你的交叉编译器设置。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 66311
精华: 0
发帖: 2
金钱: 10 两
威望: 2 点
综合积分: 4 分
注册时间: 2012-03-28
最后登录: 2012-07-30
2楼  发表于: 2012-03-29 10:50
我是依照光碟中的手冊安裝~測試編譯hello word~就出錯這樣的警告~
不過還是有編譯出執行檔~可以執行~指令arm-linux-gcc -v也是正常顯示版本~

kevin@kevin-T60:/opt/FriendlyARM/mini2440/examples/hello$ file hello
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped



cat Makefile
CROSS=arm-linux-

all: hello

hello:
    $(CROSS)gcc -o hello hello.c

clean:
    @rm -vf hello *.o *~