建立交叉编译环境(arm-linux-gcc)linux系统内核版本:2.6.32-358.el6.x86_64(在64位系统上安装32位程序需要另外安装一些库)arm-linux-gcc版本:本文安装的是友善之臂tiny6410光盘中自带的arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz1. 创建工作目录/opt/FriendlyARM/tools/arm-linux-gcc-4.5.12. 解压arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz到/opt/FriendlyARM/tools/arm-linux-gcc-4.5.13. 将编译器路径系统环境变量vim /root/.bashrc在最后添加export PATH=$PATH:/opt/FriendlyARM/tools/arm-linux-gcc-4.5.1/bin4. 重启系统5. 查看arm-linux-gcc版本arm-linux-gcc -v错误提示:-bash: ./arm-linux-gcc: /lib/ld-linux.so.2: bad ELF interPReter: No such file or directory解决方法:yum whatprovides ld-linux.so.2从打印信息中得知缺少库glibc-2.12-1.132.el6.i686yum install glibc-2.12-1.132.el6.i686再次执行arm-linux-gcc -v可正常显示6. 编译测试代码arm-linux-gcc -o test test.c错误提示:/opt/FriendlyARM/tools/arm-linux-gcc-4.5.1/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.1/../../../../arm-none-linux-gnueabi/bin/as: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory解决方法:yum whatprovides libz.so.1从打印信息中得知缺少库zlib-1.2.3-29.el6.i686yum install zlib-1.2.3-29.el6.i686再次编译可通过。