免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6024 | 回复: 6
打印 上一主题 下一主题

gcc 无法编译C++问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-20 11:59 |只看该作者 |倒序浏览
redhat es 5  系统下, gcc 的rpm安装怎样卸载掉,由于机子上安装的版本太多, 导致C++不能编译了,现在想全部卸载掉,重新安装 gcc rpm包。

    有没有那位高手指点一下么样操作。 本人查了相关资料,试了无数方法,就是不成功呀。

论坛徽章:
0
2 [报告]
发表于 2009-04-20 13:29 |只看该作者

C++不能编译

是不是没有安装gcc-c++?

[ 本帖最后由 diyself 于 2009-4-20 13:32 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2009-04-20 13:32 |只看该作者
怎么编译不过去?说清楚。

论坛徽章:
0
4 [报告]
发表于 2009-04-20 13:37 |只看该作者
:0  gCC安装了。 当时安装系统时,我测试过了。都可以的,后来机子交给软件部,那帮人,乱搞一通后,就不能正常编译C++ 了。我看了一下,里面有三个版本:
[root@linux8 ~]# gcc -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,java,f77 --enable-java-awt=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)
很奇怪的是  host=x86_64-redhat-linux    但是:/usr/include/c++/3.4.3里面,没有x86_64-redhat-linux 目录,只有 i386的目录,奇怪?请高手指点,  想把多于的版本,全卸了。重新安装gcc

[root@linux8 c++]# cd 3.4.3
[root@linux8 3.4.3]# pwd
/usr/include/c++/3.4.3
[root@linux8 3.4.3]# ls
algorithm  cassert  ciso646  complex  cstddef  ctime     debug                ext                iomanip   istream   locale  numeric  sstream    string    vector
backward   cctype   climits  csetjmp  cstdio   cwchar    deque                fstream            ios       iterator  map     ostream  stack      typeinfo
bits       cerrno   clocale  csignal  cstdlib  cwctype   exception            functional         iosfwd    limits    memory  queue    stdexcept  utility
bitset     cfloat   cmath    cstdarg  cstring  cxxabi.h  exception_defines.h  i386-redhat-linux  iostream  list      new     set      streambuf  valarray

论坛徽章:
0
5 [报告]
发表于 2009-04-20 13:39 |只看该作者
test.cpp  在其它  32位或64位的机子上,都能正常编译.

编译  [root@linux8 soft]# less test.cpp
#include <iostream>

int main()
{
using namespace std;
    cout << "Hello" << endl;
    return 0;
}
test.cpp (END)
报一大堆错误,   
报错代码如下:
[root@linux8 soft]# less test.cpp.log
In file included from test.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../include/c++/3.4.3/iostream:44:28: bits/c++config.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../include/c++/3.4.3/ios:44,
                 from /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../include/c++/3.4.3/ostream:45,
                 from /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../include/c++/3.4.3/iostream:45,
                 from test.cpp:1:
这段报错,一直重复出现。

[ 本帖最后由 城市流浪人 于 2009-4-20 13:44 编辑 ]

论坛徽章:
0
6 [报告]
发表于 2009-04-20 13:53 |只看该作者
很奇怪的是  host=x86_64-redhat-linux    但是:/usr/include/c++/3.4.3里面,没有x86_64-redhat-linux 目录,只有 i386的目录,奇怪?请高手指点,  想把多于的版本,全卸了。重新安装gcc

你还是重装吧。

论坛徽章:
0
7 [报告]
发表于 2009-04-20 13:57 |只看该作者
现在的问题所在是:   Gcc 都是在系统安装时,安装上去的rpm包。  现在,俺不知道怎么样才能,把所有的gcc 版本都卸载掉。
  rpm -e 不行的,关联软件太多,更本就不让你卸载呀。  还望指点。 先谢谢了 !

[ 本帖最后由 城市流浪人 于 2009-4-20 14:11 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP