LinuxSir.cn,穿越时空的Linuxsir!

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

安装GCC3.4.0后不能编译程序!

[复制链接]
发表于 2004-8-26 17:39:24 | 显示全部楼层 |阅读模式
出错信息如下:

[root@localhost Fantasy]# gcc34 Cpp.cpp -o win
In file included from /usr/GCC/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/backward/iostream.h:31,
                 from Cpp.cpp:2:
/usr/GCC/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
/tmp/ccomhC6B.o: In function `std::__verify_grouping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/tmp/ccomhC6B.o(.text+0xd): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'
/tmp/ccomhC6B.o(.text+0x60): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >:perator[](unsigned int) const'
/tmp/ccomhC6B.o(.text+0x9f): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >:perator[](unsigned int) const'
/tmp/ccomhC6B.o(.text+0xce): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >:perator[](unsigned int) const'
/tmp/ccomhC6B.o: In function `main':
/tmp/ccomhC6B.o(.text+0x127): undefined reference to `std::cout'
/tmp/ccomhC6B.o(.text+0x12c): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std:perator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccomhC6B.o: In function `__static_initialization_and_destruction_0(int, int)':
/tmp/ccomhC6B.o(.text+0x155): undefined reference to `std::ios_base::Init::Init()'
/tmp/ccomhC6B.o(.text+0x170): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccomhC6B.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

我看了一下G++的版本,然后用G++编译了一次:

[root@localhost Fantasy]# g++34 -v
Reading specs from /usr/GCC/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Configured with: /root/gcc-3.4.0/configure --prefix=/usr/GCC
Thread model: posix
gcc version 3.4.0
[root@localhost Fantasy]# g++34 Cpp.cpp -o win
In file included from /usr/GCC/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/backward/iostream.h:31,
                 from Cpp.cpp:2:
/usr/GCC/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
[root@localhost Fantasy]# ./win
./win: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

因为想安WINE但要看GCC3.x所以想知道能不能正常安上WINE.如何调试GCC?
发表于 2004-8-26 18:25:15 | 显示全部楼层
估计没有安装程序库
libstdc,glibc,glib2......之类的
 楼主| 发表于 2004-8-27 12:37:29 | 显示全部楼层
我下载的那个包足足有30M呢~还没有安上那几个程序库
ftp://ftp.cs.cuhk.edu.hk/pub/gnu ... .0/gcc-3.4.0.tar.gz
发表于 2004-8-27 13:04:40 | 显示全部楼层
需要libstdc++
发表于 2004-8-27 14:43:03 | 显示全部楼层
./win: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

是否安装了libstdc++
或者检查共享库文件的路径是否包括你的安装路径
发表于 2004-8-27 14:47:20 | 显示全部楼层
最初由 fantasyliu 发表
我下载的那个包足足有30M呢~还没有安上那几个程序库
ftp://ftp.cs.cuhk.edu.hk/pub/gnu ... .0/gcc-3.4.0.tar.gz

一般不在这个包内
 楼主| 发表于 2004-8-27 19:12:30 | 显示全部楼层
最初由 zonzi 发表
估计没有安装程序库
libstdc,glibc,glib2......之类的


那根据你的经验,你说的这几东西能一起下载到吗?(大不大呀?)

或者说一下我应该怎么办?

我现在只能用2.96的那个版本!是不是现在安装wine会失败呀!
 楼主| 发表于 2004-8-27 19:18:08 | 显示全部楼层
最初由 zonzi 发表
估计没有安装程序库
libstdc,glibc,glib2......之类的


那根据你的经验,你说的这几东西能一起下载到吗?(大不大呀?)

或者说一下我应该怎么办?

我现在只能用2.96的那个版本!是不是现在安装wine会失败呀!
发表于 2004-8-27 19:31:05 | 显示全部楼层
可以下载/安装RH的RPM包,好像专门有个下载的网站,叫rpmfinder之类的,可以去RH版找找
 楼主| 发表于 2004-8-27 20:29:40 | 显示全部楼层
最初由 aaccdd 发表
是否安装了libstdc++
或者检查共享库文件的路径是否包括你的安装路径


可以说明步骤吗?

还有我那个2.96的GCC没有卸载,用不用卸载啊?

如果要卸载是用rpm -e gcc这个吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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