install gcc under suse
SUSE11中安装GCC开发环境
安装包下载网站:http://213.174.32.130/sles/distribution/11.0-SP1/repo/disk1/suse/x86_64/
RPM包搜索网址:http://rpm.pbone.net/
查看Linux的版本
linux:~ # cat /etc/issue
Welcome to SUSE Linux Enterprise Server 11SP1 (x86_64) - Kernel \r (\l).
查看Linux的内核
linux:~ # cat /proc/version
Linux version 2.6.32.12-0.7-default(geeko@buildhost) (gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSELinux) ) #1 SMP 2010-05-20 11:14:20 +0200
安装gcc和g++
1)挂载ISO镜像文件(需要root权限):
#mkdir /mnt/iso
#mount-o loop -t iso9660 <iso file> /mnt/iso
或者插入光驱挂载:
#mkdir /mnt/cdrom
注:查看CDROM设备名称的方法,一般为/dev/cdrom:
* 执行:$ dmesg |egrep -i --color 'cdrom|dvd|cd/rw|writer'
[ 5.437164] sr0 : scsi3-mmc drive: 24x/24x writerdvd-ram cd/rw xa/form2 cdda tray
[ 5.437307] cdrom: Uniform CD-ROM driverRevision: 3.20
* 执行:$ less/proc/sys/dev/cdrom/info
CD-ROMinformation, Id: cdrom.c 3.20 2003/12/17
drive name: sr0
drive speed: 24
* 执行: lsblk(列出所有块设备)
# mount -t iso9660 /dev/cdrom /mnt/cdrom
2)进入到安装位置:
# cd<cdrom>/suse
依赖关系(安装64位即可,无需安装32位):
- 安装glibc-devel-2.9-13.2.x86_64.rpm
-- 需要linux-kernel-headers-2.6.27-2.22.noarch.rpm
- 安装 gcc-4.3-62.198.x86_64.rpm
-- 需要安装gcc43-4.3.3_20081022-11.18.x86_64.rpm
- 安装glibc-devel-32bit-2.9-13.2.x86_64.rpm
- 安装gcc-32bit-4.3-62.198.x86_64.rpm
-- 需要安装gcc43-32bit-4.3.3_20081022-11.18.x86_64.rpm
--- 需要安装libgomp43-32bit-4.3.3_20081022-11.18.x86_64.rpm
- 安装libstdc++43-devel-4.3.3_20081022-11.18.x86_64.rpm
- 安装gcc-c++-4.3-62.198.x86_64.rpm
-- 需要安装gcc43-c++-4.3.3_20081022-11.18.x86_64.rpm
- 安装libstdc++43-devel-32bit-4.3.3_20081022-11.18.x86_64.rpm
- 安装libstdc++-devel-4.3-62.198.x86_64.rpm
3)安装安装glibc-devel
rpm -ivh noarch/linux-kernel-headers-2.6.32-1.4.13.noarch.rpm
# rpm -ivhglibc-devel-2.11.1-0.17.4.x86_64.rpm
4)安装gcc
# rpm -ivh gcc43-4.3.3_20081022-11.18.x86_64.rpm
# rpm -ivh gcc-4.3-62.198.x86_64.rpm
5)安装g++
# rpm -ivh libstdc++-devel-4.3-62.198.x86_64.rpm
# rpm -ivh libstdc++43-devel-4.3.3_20081022-11.18.x86_64.rpm
# rpm -ivh gcc-c++-4.3-62.198.x86_64.rpm
# rpm -ivh gcc43-c++-4.3.3_20081022-11.18.x86_64.rpm
Yast源搭建
1)挂载ISO镜像
新建一个目录
mkdir /mnt/iso
将iso文件mount到该目录上:
mount -o loop/data/suse11sp1/64-GM-DVD1.iso /mnt/iso
2)增加zypper安装源
zypperaddrepo /mnt/iso/ suse11sp1iso
或者 zypper sa file:///mnt/iso/ suse11sp1iso
注:直接挂载 ISO 镜像文件,路径 <iso-path> 自行修改,命令:
# zypper sa iso:///?iso=<iso-path>/SLES-11-SP1-x86_64-DVD1.iso
# zypper refresh 刷新生效, ISO 被识别为 yast 源。
3)显示zypper安装源命令:
zypper repos
zypper lr
4)安装GCC、G++
zypper insallgcc-c++
zyppr install gcc
安装笔记:Suse安装gcc
经常看到同学在用Suse时,出现这样那样的问题,于是大家就经常在一起讨论,一起解决。从中我们付出了汗水,但收获了知识。Suse还是比较常用的,于是我研究了一下Suse安装gcc,在这里拿出来和大家分享一下,希望对大家有用。今天主要说的是Suse安装gcc的方法。
1.获得程序
cpp-3.3.3-43.24.i586.rpm
glibc-devel-2.3.3-98.28.i586.rpm
gcc-3.3.3-43.24.i586.rpm
根据安装过程中所缺的包,进行补充。
2.准备安装GCC
# rpm -ivh gcc-3.3.3-43.24.i586.rpm
error: Failed dependencies:
glibc-devel is needed by gcc-3.3.3-43.24
cpp = 3.3.3-43.24 is needed by gcc-3.3.3-43.24
3.安装GCC必须软件
1)安装glibc-devel
#rpm -ivh glibc-devel-2.3.3-98.28.i586.rpm
Preparing... ########################################### [100%]
1:glibc-devel ########################################### [100%]
2)安装cpp
#rpm -ivh cpp-3.3.3-43.24.i586.rpm
Preparing... ########################################### [100%]
package cpp-3.3.3-43.41 (which is newer than cpp-3.3.3-43.24) is already installed
file /usr/bin/cpp from install of cpp-3.3.3-43.24 conflicts with file from package cpp-3.3.3-43.41
file /usr/lib/gcc-lib/i586-suse-linux/3.3.3/cc1 from install of cpp-3.3.3-43.24 conflicts with file from package cpp-3.3.3-43.41
file /usr/share/man/man1/cpp.1.gz from install of cpp-3.3.3-43.24 conflicts with file from package cpp-3.3.3-43.41
可以发现系统遭已安装了cpp,只是版本冲突。
3)执行gcc安装
# rpm -ivh gcc-3.3.3-43.24.i586.rpm
error: Failed dependencies:
cpp = 3.3.3-43.24 is needed by gcc-3.3.3-43.24
发现系统还是识别不了cpp
4)强制安装版本cpp-3.3.3-43.24
# rpm -ivh cpp-3.3.3-43.24.i586.rpm --nodeps --force
Preparing... ########################################### [100%]
1:cpp ########################################### [100%]
5)再次安装gcc
# rpm -ivh gcc-3.3.3-43.24.i586.rpm
Preparing... ########################################### [100%]
1:gcc ########################################### [100%]
6)测试gcc
# which gcc
/usr/bin/gcc
#vi test.c
test.c内容如下:
#include <stdio.h>
main()
{
printf("\nGCC is OK!\n\n");
}
编译test.c
# gcc -O test.c -o test
生成可执行文件test(通过ls命令可以看到) 运行 test
#./test
屏幕输出
GCC is OK!
说明GCC程序编译正确。
7)加入相应的环境变量PATH,LD_LIBRARY_PATH即可。
这样就完成了Suse安装gcc的步骤。
install gcc under suse的更多相关文章
- 【Linux】-NO.86.Linux.6.C.1.001-【CentOS 7 Install GCC】-
1.0.0 Summary Tittle:[Linux]-NO.86.Linux.6.C.1.001-[CentOS 7 Install GCC]- Style:Java Series:Log4j S ...
- bsd pkg install gcc gmake cmake gdb cgdb
bsd pkg install gcc gmake cmake gdb cgdb 安装pkg帮助文档并查看文档# pkg help install# man pkg-install # pkg sea ...
- 安装g++,在centos上执行yum -y install gcc gcc-c++ libstdc++-devel
Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * base: mirrors.1 ...
- ubuntu 12.04 install gcc 4.8
http://askubuntu.com/questions/271388/how-to-install-gcc-4-8-in-ubuntu-12-04-from-the-terminal sudo ...
- How to install starDIct on suse OS?
1. Access page http://code.google.com/p/stardict-3/ to download starDict package or use zypper in to ...
- suse安装gcc,升级到4.8.5
前面这些是挂载iso,如果iso可以使用,就不需要下面几步. cd /etc/zypp/repos.d mkdir iso chmod -R 777 iso mount -o loop /media/ ...
- suse 安装gcc
1)挂载ISO镜像 新建一个目录: mkdir /mnt/iso 将ISO文件挂载到该目录上: mount -o loop /opt/SLES-11-SP3-DVD-x86_64-GM-DVD1.is ...
- 如何处理错误消息Please install the gcc make perl packages
如何处理这行错误消息? Please install the gcc make perl packages from your distribution. 执行命令行:yum install gcc ...
- suse linux通过iso文件安装gcc
mount -t iso9660 -o loop SLES-11-SP4-DVD-x86_64-GM-DVD1.iso /media/#仅仅上述iso1即可 不需要mount iso2 mount - ...
随机推荐
- 一看就会之—利用IIS服务发布网站(实践篇)上
转自:http://blog.csdn.net/zwk626542417/article/details/9796259 概述 IIS全称为互联网信息服务,是由微软公司提供的基于运行Microsoft ...
- Ogre中OctreeSceneManager
转自:http://blog.csdn.net/yanonsoftware/article/details/1067265 既然前面分析Mesh(Entity,SceneNode)的渲染时已经看到了O ...
- (转)如何在Windows上安装多个MySQL
原文:http://www.blogjava.net/hongjunli/archive/2009/03/01/257216.html 如何在Windows上安装多个MySQL 本文以免安装版的mys ...
- compare:(字符串的大小比较)
1.字符串的比较是按照ascall码进行比较的 比如A比a的值小, if([string1 compare:string2] == (以下描述)) 如果比较的结果是NSOrderedDescendin ...
- 产生冠军 map 的 应用 .
开始 比赛 , 每一次的 比赛 都会有人失败 , 如果产生英雄的话 , 那就是产生 唯一一个 没有被打败的人 , 就是英雄, . #include<stdio.h> #includ ...
- 并列div自动等高
并列div自动等高 方法一:css控制 <!DOCTYPE html> <html lang="en"> <head> <meta cha ...
- Unity3D ShaderLab Use Properties
在上一篇,学会了怎么使用ShaderLab 语法:Properties,这一次,我们将会使用属性值点亮材质球. 1:Delete>sampler2D _MainTex; 2:1行位置Add> ...
- 【转】为什么我要用 Node.js? 案例逐一介绍
原文转自:http://blog.jobbole.com/53736/ 介绍 JavaScript 高涨的人气带来了很多变化,以至于如今使用其进行网络开发的形式也变得截然不同了.就如同在浏览器中一样, ...
- 在Runbook中添加Checkpoint-workflow
本文说明的是使用Checkpoint-workflow的一种场景(当然还有其他场景需要Checkpoint-workflow). 起因:Windows Azure对Automation账户中的Runb ...
- magento十大免费插件
10. 自定义分层导航风格URL:http://www.magentocommerce.com/magento-connect/custom-layered-navigation-style.html ...