天天看点

ubuntu64位系统用32位的交叉工具链

export PATH=$PATH:/usr/local/tools/linux/arm/gcc-3.2.2/bin

export PATH

source /root/.bashrc

ubuntu64位系统用32位的交叉工具链

PC:ubuntu12.10-64位

交叉工具链:mipsel-linux-gcc-32位

  www.2cto.com  

查看工具链版本的时候出现以下错误:

[email protected]:/home/11# mipsel-linux-gcc -v

bash: /opt/gcc-4.3-ls232-softfloat/bin/mipsel-linux-gcc: No such file or directory

出现问题的原因:

你的计算机上安装的是64位的操作系统,但是交叉工具链是32位的,出现兼容问题,安装32位共

享库之后,能解决绝大部分兼容性问题:sudo apt-get install ia32-lib*

64位系统下GCC静态编译32位程序:

arm-linux-gcc  -o test test.c 

--------------------------------------------------------------------------------

#include<stdio.h>

#include<stdlib.h>

int main()

{

        printf("hello\n");

        return 0;

}

-------------------------------------------------------------------------------

继续阅读