在Ubuntu 12.04上升级GCC 4.6.3到4.8.2 [英] Upgrade GCC 4.6.3 on Ubuntu 12.04 to 4.8.2

查看:335
本文介绍了在Ubuntu 12.04上升级GCC 4.6.3到4.8.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即将编译需要独立的C ++编译器



<$ p $我准备将Ubuntu 12.04提供的默认GCC(版本4.6.3)更新到4.8.2 p> admin @ ubuntu:/ usr / local / gcc_build $ sudo make

结束于

  configure:错误:C ++编译器缺失或操作中失败
make [2]:*** [configure -stage1-libcpp]错误1

因此我转向 g ++ 安装时首选最新版本,这意味着我想直接从源代码进行编译,而不是 apt-get 。但严重的是,我无法找到源!(O_o)。另一方面,GCC的源代码是否也与我下载的tar文件中的 g ++ 不一致?感谢。



问题仍未解决: admin @ ubuntu:/ usr / local / gcc_build $ /home/admin/gcc-4.8.2 / configure --enable-languages = c,c ++

解决方案



以下命令适用于gcc 4.7。它们应该可以适用于gcc 4.8:

  sudo apt-get install libmpfr-dev libgmp3-dev libmpc-dev flex bison 

svn checkout svn://gcc.gnu.org/svn/gcc/trunk

cd trunk

./configure --prefix = /opt/gcc-4.8.2/usr/local/gcc-4.8.2 --enable-languages = c,c ++

make

make install

编译器将被放置在 / opt / 目录中,因此您必须使用它从那里。


I'm about to update default GCC (version 4.6.3) shipped by Ubuntu 12.04 to 4.8.2, though the compilation requires a standalone C++ compiler

admin@ubuntu: /usr/local/gcc_build$ sudo make

ends up with

configure: error: C++ compiler missing or inoperational
make[2]: *** [configure-stage1-libcpp] Error 1

Therefore I turn to the process of g++ installation with a preference to the latest version, which means that I would like to compile from source directly rather than apt-get. But seriously, I can't find the source anyway!(O_o). On the other hand, does the source of GCC also come along with that of g++ in the tar file I downloaded, or not? Thanks.

PS: problem remains unsolved with admin@ubuntu: /usr/local/gcc_build$ /home/admin/gcc-4.8.2/configure --enable-languages=c,c++

解决方案

You can easily compile the sources.

The following commands worked for gcc 4.7. They should be fine for gcc 4.8 as well:

sudo apt-get install libmpfr-dev libgmp3-dev libmpc-dev flex bison

svn checkout svn://gcc.gnu.org/svn/gcc/trunk

cd trunk

./configure --prefix=/opt/gcc-4.8.2/usr/local/gcc-4.8.2 --enable-languages=c,c++

make

make install

The compiler will be placed in the /opt/ directory, so you have to use it from there.

这篇关于在Ubuntu 12.04上升级GCC 4.6.3到4.8.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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