LinuxSir.cn,穿越时空的Linuxsir!

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

gcc4.0带来许多问题, 怎样用回3.x版的gcc呢?

[复制链接]
发表于 2005-9-25 04:53:53 | 显示全部楼层 |阅读模式
这几天碰到好几个程序和数学库文件都装不上,
如 FFTW, 试过了最新的3.0.1, 以前的2.1.5, 2.1.3都不行:
http://www.fftw.org
但在我另一台gcc3.4.3的机子上是可以正常安装的

所以现在想从gcc4.0换回3.x版的, 想知道有没啥方便的办法呢?
这台机子装的是Feroda Core4, 默认装上的是gcc4.0...
 楼主| 发表于 2005-9-25 04:57:35 | 显示全部楼层
[root@localhost 4.0.0]# cd /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/
[root@localhost 3.2.3]# ls
cc1       cpp0         crtbeginT.o  f771           libg2c.a   libgcc_eh.a  libstdc++.so  tradcpp0
cc1plus   crtbegin.o   crtend.o     include        libg2c.so  libgcc_s.so  libsupc++.a
collect2  crtbeginS.o  crtendS.o    libfrtbegin.a  libgcc.a   libstdc++.a  specs
[root@localhost 3.2.3]# cd /usr/lib/gcc-lib/i386-redhat-linux/2.96/
[root@localhost 2.96]# ls
crtbegin.o  crtbeginS.o  crtend.o  crtendS.o  libgcc.a  libgcc_eh.a
[root@localhost 2.96]# export GXX_ROOT=/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/
[root@localhost 2.96]# gcc -print-search-dirs
°²×°£º/usr/lib/gcc/i386-redhat-linux/4.0.0/
³ÌÐò£º=/usr/libexec/gcc/i386-redhat-linux/4.0.0/:/usr/libexec/gcc/i386-redhat-linux/4.0.0/:/usr/libexec/gcc/i386-redhat-linux/:/usr/lib/gcc/i386-redhat-linux/4.0.0/:/usr/lib/gcc/i386-redhat-linux/:/usr/libexec/gcc/i386-redhat-linux/4.0.0/:/usr/libexec/gcc/i386-redhat-linux/:/usr/lib/gcc/i386-redhat-linux/4.0.0/:/usr/lib/gcc/i386-redhat-linux/:/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../../i386-redhat-linux/bin/i386-redhat-linux/4.0.0/:/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../../i386-redhat-linux/bin/
¿â£º=/usr/lib/gcc/i386-redhat-linux/4.0.0/:/usr/lib/gcc/i386-redhat-linux/4.0.0/:/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.0.0/:/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../../i386-redhat-linux/lib/:/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../i386-redhat-linux/4.0.0/:/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../:/lib/i386-redhat-linux/4.0.0/:/lib/:/usr/lib/i386-redhat-linux/4.0.0/:/usr/lib/
[root@localhost 2.96]# gcc --version
gcc (GCC) 4.0.0 20050519 (Red Hat 4.0.0-8)
Copyright (C) 2005 Free Software Foundation, Inc.

看上面, 好象系统中还有个3.2.3, 可以怎么改gcc/g++的编译环境呢?
回复 支持 反对

使用道具 举报

发表于 2005-9-25 09:24:18 | 显示全部楼层
对啊,有关于GCC4的问题哪位达人解释一下究竟是怎么一回事。是函数库不同还是编译的过程不一样?
不然编程序都提心吊胆的……
回复 支持 反对

使用道具 举报

发表于 2005-9-25 10:07:16 | 显示全部楼层
fix your code first...
回复 支持 反对

使用道具 举报

发表于 2005-9-25 10:51:22 | 显示全部楼层
It is possible to install multiple versions of gcc in your system.  You may install gcc-3.x along with your 4.x.
回复 支持 反对

使用道具 举报

发表于 2005-9-25 11:04:10 | 显示全部楼层
看来又是两位屈服于LINUX原语言威势的同僚啊……
想当年偶也曾在为爱机中文化失败之后屈服与它……
回复 支持 反对

使用道具 举报

发表于 2005-9-25 11:14:16 | 显示全部楼层
I still encounter ABI compatibility problems.  Even some packages may be compiled successfully with gcc-4.0.x, it does not run properly!  I have to stay with gcc-3.3.x.
回复 支持 反对

使用道具 举报

发表于 2005-9-25 12:58:55 | 显示全部楼层
要么用compat-gcc-32,要么升到gcc 4.0.1试试,感觉gcc 4.0.1能好许多。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-25 13:37:19 | 显示全部楼层
3ks! i'll try....
回复 支持 反对

使用道具 举报

发表于 2005-9-25 14:07:21 | 显示全部楼层
我ubuntu下装nvidia显卡驱动也碰到这样问题


$CC=gcc-3.4
$export CC
解决了
回复 支持 反对

使用道具 举报

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

本版积分规则

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