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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM