如何在Linux Mint上安装GCC 4.7.2? [英] How to install GCC 4.7.2 on Linux Mint?
问题描述
我需要在Linux Mint 13上安装最新版本的GCC。我发现Ubuntu 12.04有一些有用的终端命令,但似乎互联网上没有类似的Mint存在...
编辑:我解决了这个问题,为了帮助其他人,编写这些命令:
sudo add -apt-repository ppa:ubuntu-toolchain -r / test
一切正常。 :) 我遵循此处的说明,但是我首先下载并提取了gcc 4.7.2,而不是最后一个,并替换了步骤3到5,并运行随附的脚本(这会为您执行这些步骤): 您可以从其中一个镜像站点下载gcc源代码: http://gcc.gnu.org/mirrors.html 编辑:在帖子中添加说明 $ sudo apt-get install gcc-multilib m4 sudo apt-get update $ c
$ b sudo apt-get install g ++ - 4.7 c ++ - 4.7
gcc-4.7.2 / contribs / download_prerequisites
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 <
添加这些符号链接的原因相同:
$ 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
运行gcc-4.7.2 / contribs / download_prerequisites
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
Download and extract g++-4.7.2
$sudo apt-get install gcc-multilib m4
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
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
run gcc-4.7.2/contribs/download_prerequisites
configure, make, make install
这篇关于如何在Linux Mint上安装GCC 4.7.2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!