gcc 4.5安装问题下ubuntu [英] gcc 4.5 installation problem under ubuntu

查看:204
本文介绍了gcc 4.5安装问题下ubuntu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在ubuntu 10.04上安装gcc 4.5但失败。
这里是一个编译错误,我不知道如何解决。有没有人成功安装最新的gcc ubuntu?
以下是我的步骤和错误消息,我想知道问题在哪里。

I tried to install gcc 4.5 on ubuntu 10.04 but failed. Here is a compile error that I don't know how to solve. Is there anyone successfully install the latest gcc on ubuntu? Following is my steps and the error message, I'd like to know where is the problem....

步骤1:下载这些文件:

Step1: download these files:

gcc-core-4.5.0.tar.gz
gcc-g++-4.5.0.tar.gz
gmp-4.3.2.tar.bz2
mpc-0.8.1.tar.gz
mpfr-2.4.2.tar.gz

步骤2:解压缩文件

步骤3:将gmp,mpc,mpfr移至gcc-4.5。 0 /目录。

Step3: move gmp, mpc, mpfr to the gcc-4.5.0/ directory.

mv gmp-4.3.2  gcc-4.5.0/gmp
mv mpc-0.8.1  gcc-4.5.0/mpc
mv mpfr-2.4.2 gcc-4.5.0/mpfr


$ b b

步骤4:转到gcc-4.5.0目录并进行配置:

Step4: go to gcc-4.5.0 directory and do configuration:

sudo ./configure

步骤5:编译和安装

sudo make
sudo make install

前4个步骤都OK,I可以配置成功。但是,当我尝试编译它,下面的错误信息出来,我不知道什么问题是。我应该将名称从gcc 4.5更改为gcc??这是一个有点奇怪,我们需要这样做我们自己。在安装过程中有没有什么我错过了?

The first 4 steps is OK, I can configure it successfully. However, when I try to compile it, following error message comes out, I cannot figure out what the problem is. Should I change the name from "gcc 4.5" to "gcc"?? It's a little strange that we need to do this by ourself. Is there anything I missed during the installation?

xxx@xxx-laptop:/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0$ sudo make
[sudo] password for xxx: 
[ -f stage_final ] || echo stage3 > stage_final
/bin/bash: line 2: test: /media/Data/Tool/linux/gcc: binary operator expected
/bin/bash: /media/Data/Tool/linux/gcc: No such file or directory
make[1]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[2]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[3]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
rm -f stage_current
make[3]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[2]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[2]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
Configuring stage 1 in host-x86_64-unknown-linux-gnu/intl
/bin/bash: /media/Data/Tool/linux/gcc: No such file or directory
make[2]: *** [configure-stage1-intl] Error 127
make[2]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make: *** [all] Error 2


推荐答案

这可能不是一个好主意,

It might not be a good idea to have a space in your path - it's kind of rare and can easily mess up shell scripts that aren't specially designed to deal with it (which is a bad combination!)

另一个潜在的问题问题是您在 gcc 源目录中运行 configure - 此不推荐使用(至少对于 gcc的一个版本我完全不能使用) 4 )。而是创建一个空的构建目录,与源目录平行,所以你有类似:

Another potential problem is that you're running configure inside the gcc source directory - this isn't recommended (and didn't work at all for me on at least one version of gcc 4). Instead make an empty build directory, parallel to the source directory, so you have something like:

gcc 4.5            <- but might want to avoid the space
  gcc-4.5.0
    ...
  build

然后 cd 进入 build 并运行

../gcc-4.5.0/configure

您可能还需要从新解压缩的源目录开始,因为先前失败的构建可能已损坏它。

You may also need to start from a freshly unzipped source directory, as the previous failed build may have broken it.

这篇关于gcc 4.5安装问题下ubuntu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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