安装GCC-4.1.1,问题解决
2009-10-20 12:04
316 查看
今安装GCC-4.1.1,遇到问题于下,(复制别人的,参考:http://www.linuxdiyf.com/bbs/thread-159161-1-1.html。因问题一样,但我已经完整解决该问题)
由于某种需要,需要把Fedora11 gcc的版本降到4.1.1,使用yum install gcc只会更新现有版本,不降反升了,那么只能通过其它途径进行安装,其过程如下:
1、先下载gcc-4.1.1.tar.bz2文件于/tmp目录下,并对其进行解压,于是在/tmp下有了gcc-4.1.1目录,它就是gcc-4.1.1的源目录
2、在/tmp下再建立一个gcc-4.1.1-bulid目录,作为gcc-4.1.1的目标目录。
3、在/usr/local下建立gcc-4.1.1-dest目录,作为gcc-4.1.1的配置目录。(需要root权限,所以可以这么做:sudo mkdir /usr/local/gcc-4.1.1-dest)
4、在gcc-4.1.1-bulid目录下(必须的),执行以下命令:
/tmp/gcc-4.1.1/configure --prefix=/usr/local/gcc-4.1.1-dest --enable-threads=posix --disable-checking --enable--long-long --with-system-zlib --enable-languages=c,c++,java(在http://hi.baidu.com/boyliupan/bl ... 259985800a18d2.html上还加了选项:--host=i386-redhat-linux,我不知它是什么意思,而且加了提示找不到i386-redhat-linux,于是没有加,其它选项也不知其意) //注by_benhu:我去掉了:--host=i386-redhat-linux,因为我的是X86_64,
5、进行编译,执行:make
于是出现以下错误提示:
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
make[3]: *** [fastjar.info] 错误 1
make[3]: Leaving directory `/tmp/gcc-4.1.1-build/fastjar'
make[2]: *** [all] 错误 2
make[2]: Leaving directory `/tmp/gcc-4.1.1-build/fastjar'
make[1]: *** [all-fastjar] 错误 2
make[1]: Leaving directory `/tmp/gcc-4.1.1-build'
make: *** [all] 错误 2
此错误解决:
安装英文提示:可知是因为缺少依赖包Texinfo或GNU MAKE包,前者包含后者。
在目标文件目录下运行:$ yum install texinfo
安装完毕,查看makeinfo所在目录:
$ whereis makeinfo,
显示:usr/bin/makeinfo。
3、修改/tmp/gcc-4.1.1-bulid目录下的Makefile,把.../missing makeinfo改成usr/bin/makeinfo.
重新执行:make
又冒出新的错误:error: gnu/stubs-32.h: No such file or directory
我到/usr/include/gnu下一看,果然没有这一头文件,于是:
执行:yum -y install glibc-devel
但是还是冒出同样的问题,在看/usr/include/gnu下的文件,有一个stubs-64.h的头文件。可能我的是X86_64的,所以只有这一文件,不支持i386,为了得到stubs-32.h,支持这个编译器,我安装了一个i386arch的glibc-devel.i386的包:
运行:yum -y install glibc-devel.i386
再重新在gcc-4.1.1-build中make,
一切OK!
由于某种需要,需要把Fedora11 gcc的版本降到4.1.1,使用yum install gcc只会更新现有版本,不降反升了,那么只能通过其它途径进行安装,其过程如下:
1、先下载gcc-4.1.1.tar.bz2文件于/tmp目录下,并对其进行解压,于是在/tmp下有了gcc-4.1.1目录,它就是gcc-4.1.1的源目录
2、在/tmp下再建立一个gcc-4.1.1-bulid目录,作为gcc-4.1.1的目标目录。
3、在/usr/local下建立gcc-4.1.1-dest目录,作为gcc-4.1.1的配置目录。(需要root权限,所以可以这么做:sudo mkdir /usr/local/gcc-4.1.1-dest)
4、在gcc-4.1.1-bulid目录下(必须的),执行以下命令:
/tmp/gcc-4.1.1/configure --prefix=/usr/local/gcc-4.1.1-dest --enable-threads=posix --disable-checking --enable--long-long --with-system-zlib --enable-languages=c,c++,java(在http://hi.baidu.com/boyliupan/bl ... 259985800a18d2.html上还加了选项:--host=i386-redhat-linux,我不知它是什么意思,而且加了提示找不到i386-redhat-linux,于是没有加,其它选项也不知其意) //注by_benhu:我去掉了:--host=i386-redhat-linux,因为我的是X86_64,
5、进行编译,执行:make
于是出现以下错误提示:
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
make[3]: *** [fastjar.info] 错误 1
make[3]: Leaving directory `/tmp/gcc-4.1.1-build/fastjar'
make[2]: *** [all] 错误 2
make[2]: Leaving directory `/tmp/gcc-4.1.1-build/fastjar'
make[1]: *** [all-fastjar] 错误 2
make[1]: Leaving directory `/tmp/gcc-4.1.1-build'
make: *** [all] 错误 2
此错误解决:
安装英文提示:可知是因为缺少依赖包Texinfo或GNU MAKE包,前者包含后者。
在目标文件目录下运行:$ yum install texinfo
安装完毕,查看makeinfo所在目录:
$ whereis makeinfo,
显示:usr/bin/makeinfo。
3、修改/tmp/gcc-4.1.1-bulid目录下的Makefile,把.../missing makeinfo改成usr/bin/makeinfo.
重新执行:make
又冒出新的错误:error: gnu/stubs-32.h: No such file or directory
我到/usr/include/gnu下一看,果然没有这一头文件,于是:
执行:yum -y install glibc-devel
但是还是冒出同样的问题,在看/usr/include/gnu下的文件,有一个stubs-64.h的头文件。可能我的是X86_64的,所以只有这一文件,不支持i386,为了得到stubs-32.h,支持这个编译器,我安装了一个i386arch的glibc-devel.i386的包:
运行:yum -y install glibc-devel.i386
再重新在gcc-4.1.1-build中make,
一切OK!
相关文章推荐
- 在Ubuntu14.04下安装gcc 6.2解决C++14支持问题
- RedHat9下安装gcc时可能遇到的问题及解决
- 安装GCC 问题解决
- Fedora8安装VMware-tools 解决gcc和kernel缺失的问题
- 黄聪:buffer overflow detected问题解决及gcc-4.1安装
- 关于安装linux redhat后无法使用yum命令安装gcc-c++问题的解决过程
- Linux下安装gcc遇到的问题,待解决
- RedHat安装GCC问题-解决依赖问题
- ubuntu 16.04 的64位 安装arm-none-linux-gnueabi-gcc的步骤和问题解决
- ubuntu-14.10下,安装gcc交叉编译器遇到问题及解决方法
- mac 独立安装 GCC 解决 <omp.h> 缺失问题
- RedHat安装GCC问题-解决依赖问题
- Ubuntu15.10上arm-linux-gcc4.3.2的安装、配置及问题解决方法
- 解决VmwareTools安装失败问题之gcc和kernel devel工具,实现共享
- 在Ubuntu中编译、安装 gcc4.1.1 过程以及遇到的问题
- buffer overflow detected问题解决及gcc-4.1安装
- 在Ubuntu14.04下安装gcc 5.3.0解决C++11支持问题
- redhad安装gcc问题---解决依赖问题
- CentOS安装GCC--解决依赖问题
- Centos6.5安装GCC遇到的问题及解决