LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1143|回复: 7

gcc去哪儿了?

[复制链接]
发表于 2008-4-10 14:59:26 | 显示全部楼层 |阅读模式
fedora8上本来一个版本的gcc4.1.2吧好像?我因为要编译别的软件需要安装一个老版的gcc 2.9,当编译完别的软件后我还想继续用4.1的版本,它去哪儿了呢?用yum系统提示已安装gcc,下个自己安装还装不上,怎么回事?原先的4.1的版本是不是还在?我把那个老版本的装在/usr/下了。
发表于 2008-4-13 01:55:28 | 显示全部楼层
我也想装gcc2.95,可是不知道怎么样装?装完之后系统不会出现问题吧?我的是redhat AS4,能否告知一下?在此谢过
回复 支持 反对

使用道具 举报

发表于 2008-4-13 10:40:10 | 显示全部楼层
可以试试
  1. yum install compat-gcc-*
复制代码
好像只有 gcc 3.4 的,2.96 的好像只有源码包,装了之后用 gcc34 或 gcc296 就可以了。
回复 支持 反对

使用道具 举报

发表于 2008-4-13 13:21:51 | 显示全部楼层
如果要make,怎么样设定才能让make调用gcc2.96呢?
回复 支持 反对

使用道具 举报

发表于 2008-4-13 15:44:07 | 显示全部楼层
可以在configure的时候指定cc编译器。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-14 17:37:05 | 显示全部楼层
我的问题怎么没人管啊?呵呵
你装了另外一个GCC可以参考下面
Using New GCC
If you installed as above, running gcc34 or any other app you installed should be directly accessible. You can verify with the following steps:

[mirandam@charon ~]$ which gcc34
/opt/gcc34/bin/gcc34
[mirandam@charon ~]$ which g++34
/opt/gcc34/bin/g++34

[mirandam@charon ~]$ gcc34 -v
Reading specs from /opt/gcc34/lib/gcc/i686-pc-linux-gnu/3.4.4/specs
Configured with: /home/mirandam/gcc/gcc-3.4.4/configure --prefix=/opt/gcc34
--program-suffix=34 --enable-languages=c,c++ --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions
Thread model: posix
gcc version 3.4.4

There are many ways to use an alternate compiler. The 3 methods I commonly use: 1. Environment Variable, 2. Configure Support, and 3. Makefile Support.

Environment Variables
Most softwares support the CC and CXX environment variables. First assign them, then run configure and/or make. Example:

# export CC=gcc34
# export CXX=g++34
# ./configure
Configure Support
If the software is using the standard GNU automake and configure, then there is a chance it supports other compilers by passing in a setting to the configure script. First run configure --help to see if it mentions anything. The following example is from MPlayer:

# ./configure --help
# ./configure --cc=gcc34
Makefile Support
Sometimes the software may just come with a Makefile. Open the Makefile and look inside to see if there are variables that specify the compiler. You can either edit those variables or set them at compile time. For example:

(in Makefile)
       
C_COMPILER = cc
CPLUSPLUS_COMPILER = c++
Then using the Makefile, you can run:

# make CPLUSPLUS_COMPILER=g++34
回复 支持 反对

使用道具 举报

发表于 2008-4-14 17:56:06 | 显示全部楼层
[QUOTE=river4321;1838132]我的问题怎么没人管啊?呵呵
/QUOTE]
compat-gcc
还不行吗?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-22 21:51:43 | 显示全部楼层
Post by pingz;1838140
[QUOTE=river4321;1838132]我的问题怎么没人管啊?呵呵
/QUOTE]
compat-gcc
还不行吗?


可以了,呵呵,多谢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表