CentOS 7如何添加gcc toolchain(32位)以及遇到的问题解决

1. 解压gcc_toolchain到/usr目录;

2. 执行:sudo gedit /etc/profile:

  添加export PATH=$PATH:/usr/.../.../bin/

3. 执行:source /etc/profile 

  通过指令:echo $PATH 查看是否有成功添加环境变量;

4. 编译对应source code,一般会遇到如下几个问题

  4.1 使用的时候出现一个错误

    bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

    是因为64位系统中安装了32位程序

    解决方法:yum install glibc.i686
  4.2 若遇到“error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
     解决方法:yum install zlib.i686
  4.3 若继续出现“error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
    解决方法:先查找这个库存在于哪个安装包中

      yum whatprovides libstdc++.so.6

    得到信息:
      Loaded plugins: fastestmirror, refresh-packagekit, security
      Loading mirror speeds from cached hostfile
      * base: mirrors.yun-idc.com
      * epel: mirror.premi.st
      * extras: mirrors.yun-idc.com
      * updates: mirrors.btte.net
      libstdc++-4.8.5-4.el7.i686: GNU Standard C++ Library
      Repo : base
      Matched from:
      Other : libstdc++.so.6

    可以看到包  libstdc++-4.8.5-4.el7.i686

    执行命令: yum install libstdc++-4.8.5-4.el7.i686

==========================================

20160719 补充

  make menuconfig的时候报错

  ./tools/mconf: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory
make: *** [menuconfig] Error 127
  解决办法: 执行 yum whatprovides libncursesw.so.5
    Loaded plugins: fastestmirror, langpacks
    Determining fastest mirrors
     * base: mirrors.aliyun.com
     * extras: mirrors.zju.edu.cn
     * updates: mirrors.aliyun.com
    ncurses-libs-5.9-13.20130511.el7.i686 : Ncurses libraries
    Repo        : base
    Matched from:
    Provides    : libncursesw.so.5
  然后执行 yum install ncurses-libs-5.9-13.20130511.el7.i686

 缺mkimage的时候

在uboot的tools里面,把这个mkimage考到/usr/bin下就行了:

#cp mkimage /usr/bin/mkimage

记得要chmod 755 mkimage

 

yum install make

yum groupinstall "Development Tools"

yum install gcc gcc-c++ kernel-devel

posted @ 2016-07-18 19:07  cutelinux  阅读(2170)  评论(1编辑  收藏  举报