在CentOS 6.4中编译安装gcc 4.8.1
2023-09-14 09:01:21 时间
分类: C/C++ Linux/Unix2013-11-28 21:02 1877人阅读 评论(0) 收藏 举报
原文链接:http://www.cnblogs.com/codemood/archive/2013/06/01/3113200.html
1. 安装gcc和g++
新安装的CentOS缺少编译环境,必须先安装旧版本的gcc, 然后再进行自举编译
yum -y install gcc
yum -y install gcc-c++
yum -y install gcc-c++
2. 下载gcc 4.8.1源码包
将源码包放在home目录的Download目录中
3. 解压缩gcc 4.8.1源码包
cd /home/User_Name/Downloads/
tar -zxvf gcc-4.8.1.tar.gz
4. 下载编译所需的依赖包
cd /home/User_Name/Downloads/gcc-4.8.1
./contrib/download_prerequisites
cd ..
5. 新建目录存放编译结果
mkdir gcc-build-4.8.1
6. 进入新目录,并执行configure命令,产生makefile
cd gcc-build-4.8.1
../gcc-4.8.1/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
../gcc-4.8.1/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
7. 编译gcc 4.8.1
make -j4
8. 安装gcc 4.8.1
sudo make install
9. 更新libstdc++.so.6
sudo cp /home/User_Name/Downloads/gcc-build-4.8.1/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.18 /usr/lib
sudo ln -sf /usr/lib/libstdc++.so.6.0.18 /usr/lib/libstdc++.so.6
sudo ln -sf /usr/lib/libstdc++.so.6.0.18 /usr/lib/libstdc++.so.6
红字部分在不同平台上有所不同
10. 检查版本
g++ --version
g++ (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcc --version
gcc (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
相关文章
- centos 镜像源_孩子镜像问题怎么解决
- LINUX centos 安装图形界面
- centos 6 编译安装内核
- 在Centos中yum安装和卸载软件的使用方法
- centos安装python环境
- 安装CentOS 8 linux 系统
- 【图文教程】Centos 7下安装Hadoop
- centos 安装 python3_centos运行python脚本
- linux开放8080端口命令_centos开放80端口
- arm64(aarch64)安装centos 7.5.1804
- Centos 6.9_centos iptables
- Centos中安装lrzsz 实现windows与Linux间文件互传
- 升级CentOS的OpenSSH 搭建SFTP Server
- 在WSL2中安装CentOS发行版
- Linux CentOS 7源码编译安装PostgreSQL9.5
- CentOS系统中Redis数据库的安装配置指南
- centos通过yum安装php的教程
- CentOS 7.3上SQL Server vNext CTP 1.2安装教程
- 在 CentOS 上安装 Redis,轻松搞定!(centos安装redis)
- 如何在CentOS 8上安装Java
- 如何在CentOS 8上使用HTTPS安装Gitea代码托管平台
- 如何在 CentOS、RHEL、Rocky Linux 最小化安装中设置互联网
- 实战案例:实现CentOS 7编译安装基于httpd 模块方式的LAMP
- CentOS下编译安装LNMP(附带软件包)
- Centos编译安装 LAMP (apache-2.4.7 + mysql-5.5.35 + php 5.4.8)
- CentOS 上快速启动MySQL(cent上启动mysql)
- CentOS进驻MySQL轻松让您拥有数据库管理权(centos进mysql)
- centOS安装MySQL更为稳定便捷的选择(centos-mysql)
- CentOS 7上CentOS 7上如何安装配置Oracle 11(oracle11如何写在)
- centos下编译安装mysql报错解决方案