如何在Linux Mint上安装GCC 4.7.2? [英] How to install GCC 4.7.2 on Linux Mint?

查看:760
本文介绍了如何在Linux Mint上安装GCC 4.7.2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Linux Mint 13上安装最新版本的GCC。我发现Ubuntu 12.04有一些有用的终端命令,但似乎互联网上没有类似的Mint存在...



编辑:我解决了这个问题,为了帮助其他人,编写这些命令:

sudo add -apt-repository ppa:ubuntu-toolchain -r / test



sudo apt-get update $ b

sudo apt-get install g ++ - 4.7 c ++ - 4.7



一切正常。 :)

解决方案



我遵循此处的说明,但是我首先下载并提取了gcc 4.7.2,而不是最后一个,并替换了步骤3到5,并运行随附的脚本(这会为您执行这些步骤):

gcc-4.7.2 / contribs / download_prerequisites



您可以从其中一个镜像站点下载gcc源代码: http://gcc.gnu.org/mirrors.html






编辑:在帖子中添加说明


  1. $ sudo apt-get install gcc-multilib m4

  2. 下载并解压g ++ - 4.7.2 为了弥补路径信息不足,将其添加到.bashrc中。



    exp ort LD_LIBRARY_PATH = / usr / local / lib:$ LD_LIBRARY_PATH

    导出LIBRARY_PATH = / usr / lib / i386-linux-gnu导出



    导出C_INCLUDE_PATH = / usr / include / i386-linux-gnu导出


    $ b export CPLUS_INCLUDE_PATH = / usr / include / i386-linux-gnu <

  3. 添加这些符号链接的原因相同:
    $ b $ sudo ln -s / usr / include / i386 -linux-gnu / gnu / stubs-32.h / usr / include / gnu



    $ sudo ln -s / usr / lib / i386-linux-gnu / crti .o /usr/lib/crti.o


    $ sudo ln -s /usr/lib/i386-linux-gnu/crt1.o / usr / lib / crt1 .o



    $ sudo ln -s /usr/lib/i386-linux-gnu/crtn.o /usr/lib/crtn.o



    $ sudo ln -s /usr/local/lib/libmpc.so.3 /usr/lib/libmpc.so.3


  4. 运行gcc-4.7.2 / contribs / download_prerequisites


  5. configure,make,make install


I need to install the latest version of GCC on Linux Mint 13. I found some useful terminal commands for Ubuntu 12.04, but it seems that nothing similar for Mint exists on the Internet...

Edit: I solved the problem, so, in order to help everybody else, write these commands:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

sudo apt-get update

sudo apt-get install g++-4.7 c++-4.7

And everything works fine. :)

解决方案

I built it from source when I did this not too long ago.

I followed the instructions here, but I downloaded and extracted gcc 4.7.2 first instead of last and replaced steps 3 to 5 with running this script that comes with it (which does those steps for you):

gcc-4.7.2/contribs/download_prerequisites

You can download the gcc sources from one of the mirror sites: http://gcc.gnu.org/mirrors.html


Edit: added the instructions in-post

  1. Download and extract g++-4.7.2

  2. $sudo apt-get install gcc-multilib m4

  3. In order to compensate for insufficient path information, added this to .bashrc

    export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

    export LIBRARY_PATH=/usr/lib/i386-linux-gnu export

    export C_INCLUDE_PATH=/usr/include/i386-linux-gnu export

    export CPLUS_INCLUDE_PATH=/usr/include/i386-linux-gnu

  4. Add these symlinks for the same reason:

    $sudo ln -s /usr/include/i386-linux-gnu/gnu/stubs-32.h /usr/include/gnu

    $sudo ln -s /usr/lib/i386-linux-gnu/crti.o /usr/lib/crti.o

    $sudo ln -s /usr/lib/i386-linux-gnu/crt1.o /usr/lib/crt1.o

    $sudo ln -s /usr/lib/i386-linux-gnu/crtn.o /usr/lib/crtn.o

    $sudo ln -s /usr/local/lib/libmpc.so.3 /usr/lib/libmpc.so.3

  5. run gcc-4.7.2/contribs/download_prerequisites

  6. configure, make, make install

这篇关于如何在Linux Mint上安装GCC 4.7.2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆