gcc错误解决方法由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“gcc常见错误解析”。
原因:因为安装其他软件,升级gcc相关的软件,造成gcc编译错误,说没有gcc,解决方法,用系统盘重新安装gcc。具体方法如下:
[root@mail /]# rpm-e--nodeps cpp
[root@mail /]# rpm-qa | grep gcc
libgcc-4.1.2-48.el5
gcc-java-4.1.2-48.el5
libgcc-4.1.2-48.el5
gcc-c++-4.1.2-48.el5
gcc-gfortran-4.1.2-48.el5
[root@mail /]# rpm-ivh /root/rpm/cpp-4.1.2-46.el5.x86_64.rpm
Preparing...########################################### [100%]
1:cpp########################################### [100%]
[root@mail /]# rpm-ivh /root/rpm/gcc-4.1.2-46.el5.x86_64.rpm
Preparing...########################################### [100%]
1:gcc########################################### [100%]
[root@mail /]# rpm-qa | grep kernel-headers
kernel-headers-2.6.18-194.26.1.el5
[root@mail /]# rpm-e--nodeps kernel-headers
[root@mail /]# rpm-qa | grep kernel-headers
[root@mail /]# rpm-ivh /root/rpm/kernel-headers-2.6.18-164.el5.x86_64.rpm
Preparing...########################################### [100%]
1:kernel-headers########################################### [100%]
[root@mail /]# rpm-qa | grep glibc-headers
glibc-headers-2.5-42
[root@mail /]# rpm-qa | grep glibc-headers
glibc-headers-2.5-42
[root@mail /]# rpm-e--nodeps glibc-headers
[root@mail /]# rpm-ivh /root/rpm/glibc-headers-2.5-42.x86_64.rpm
Preparing...########################################### [100%]
1:glibc-headers########################################### [100%]
[root@mail /]# rpm-qa | grep glibc-devel
glibc-devel-2.5-42
glibc-devel-2.5-42
[root@mail /]# rpm-e--nodeps glibc-devel
error: “glibc-devel” specifies multiple packages
[root@mail /]# rpm-q--queryformat “%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})n” glibc-devel glibc-devel-2.5-42(i386)
glibc-devel-2.5-42(x86_64)
[root@mail /]# rpm-e--nodeps glibc-devel*
error: package glibc-devel* is not installed
[root@mail /]# rpm-e--nodeps glibc-devel-2.5-42(i386)
-bash: syntax error near unexpected token `('
[root@mail /]# rpm-e--nodeps glibc-devel-2.5-42(i386)
error: “glibc-devel-2.5-42” specifies multiple packages
error: package(i386)is not installed
[root@mail /]# rpm-e--allmatches glibc-devel
error: Failed dependencies:
glibc-devel >= 2.2.90-12 is needed by(installed)gcc-4.1.2-46.el5.x86_64
[root@mail /]# rpm-qa | grep gcc
libgcc-4.1.2-48.el5
gcc-java-4.1.2-48.el5
libgcc-4.1.2-48.el5
gcc-c++-4.1.2-48.el5
gcc-gfortran-4.1.2-48.el5
gcc-4.1.2-46.el5
[root@mail /]# rpm-qa | grep glibc-devel
glibc-devel-2.5-42
glibc-devel-2.5-42
[root@mail /]# rpm-e--allmatches--nodeps glibc-devel
[root@mail /]# rpm-qa | grep glibc-devel
[root@mail /]# rpm-ivh /root/rpm/glibc-devel-2.5-42.i386.rpm
error: Failed dependencies:
binutils
[root@mail /]# rpm-ivh /root/rpm/glibc-devel-2.5-42.x86_64.rpm
error: Failed dependencies:
binutils
[root@mail /]# rpm-qa | grep binutils
binutils-2.15.92.0.2-13.0.0.0.2
binutils-2.17.50.0.6-14.el5
[root@mail /]# rpm-q--queryformat “%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})n” binutils binutils-2.17.50.0.6-14.el5(x86_64)
binutils-2.15.92.0.2-13.0.0.0.2(x86_64)
[root@mail /]# rpm-e--allmatches--nodeps binutils
/sbin/ldconfig: libraries libdb.so.2 and libgdbm.so.2.0.0 in directory /usr/lib have same soname but different type./sbin/ldconfig: libraries libdb.so.2 and libgdbm.so.2.0.0 in directory /usr/lib have same soname but different type.[root@mail /]# rpm-q--queryformat “%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})n” binutils package binutils is not installed
[root@mail /]# rpm-ivh /root/rpm/binutils-2.17.50.0.6-12.el5.x86_64.rpm
Preparing...########################################### [100%]
1:binutils########################################### [100%]
/sbin/ldconfig: libraries libdb.so.2 and libgdbm.so.2.0.0 in directory /usr/lib have same soname but different type.[root@mail /]# rpm-ivh /root/rpm/glibc-devel-2.5-42.*
Preparing...########################################### [100%]
1:glibc-devel########################################### [ 50%]
2:glibc-devel########################################### [100%]
[root@mail /]# rpm-qa | grep libgomp
libgomp-4.4.0-6.el5
[root@mail /]# rpm-e--nodeps libgomp
/sbin/ldconfig: libraries libdb.so.2 and libgdbm.so.2.0.0 in directory /usr/lib have same soname but different type.[root@mail /]# rpm-qa | grep libgomp
[root@mail /]# rpm-qa | grep libgomp*
[root@mail /]# rpm-qa | grep libstdc++-devel
libstdc++-devel-4.1.2-48.el5
[root@mail /]# rpm-e--nodeps libstdc++-devel
[root@mail /]# rpm-ivh /root/rpm/libstdc++-devel*
error: Failed dependencies:
libstdc++ = 4.1.2-46.el5 is needed by libstdc++-devel-4.1.2-46.el5.i386
libstdc++ = 4.1.2-46.el5 is needed by libstdc++-devel-4.1.2-46.el5.x86_64
[root@mail /]# rpm-qa | grep libstdc++
libstdc++-4.1.2-48.el5
compat-libstdc++-33-3.2.3-61
compat-libstdc++-296-2.96-138
libstdc++-4.1.2-48.el5
compat-libstdc++-33-3.2.3-61
[root@mail /]# rpm-ivh /root/rpm/libstdc++-devel-4.1.2-46.el5.x86_64.rpm
error: Failed dependencies:
libstdc++ = 4.1.2-46.el5 is needed by libstdc++-devel-4.1.2-46.el5.x86_64
[root@mail /]# rpm-e--nodeps libstdc++
error: “libstdc++” specifies multiple packages
[root@mail /]# rpm-e--nodeps--allmatcheslibstdc++
/sbin/ldconfig: libraries libdb.so.2 and libgdbm.so.2.0.0 in directory /usr/lib have same soname but different type./sbin/ldconfig: libraries libdb.so.2 and libgdbm.so.2.0.0 in directory /usr/lib have same soname but different type.[root@mail /]# rpm-ivh /root/rpm/libstdc++*
Preparing...########################################### [100%]
1:libstdc++########################################### [ 25%]
/sbin/ldconfig: libraries libdb.so.2 and libgdbm.so.2.0.0 in directory /usr/lib have same soname but different type.2:libstdc++########################################### [ 50%]
/sbin/ldconfig: libraries libdb.so.2 and libgdbm.so.2.0.0 in directory /usr/lib have same soname but different type.3:libstdc++-devel########################################### [ 75%]
4:libstdc++-devel########################################### [100%]
[root@mail /]# rpm-ivh /root/rpm/compat-libstdc++-
compat-libstdc++-296-2.96-138.i386.rpmcompat-libstdc++-33-3.2.3-61.i386.rpmcompat-libstdc++-33-3.2.3-61.x86_64.rpm
[root@mail /]# rpm-ivh /root/rpm/compat-libstdc++-
compat-libstdc++-296-2.96-138.i386.rpmcompat-libstdc++-33-3.2.3-61.i386.rpmcompat-libstdc++-33-3.2.3-61.x86_64.rpm
[root@mail /]# rpm-ivh /root/rpm/compat-libstdc++-*
Preparing...########################################### [100%]
package compat-libstdc++-33-3.2.3-61.x86_64 is already installed
package compat-libstdc++-296-2.96-138.i386 is already installed
package compat-libstdc++-33-3.2.3-61.i386 is already installed
[root@mail /]# rpm-ivh /root/rpm/gcc-c++-4.1.2-46.el5.x86_64.rpm
Preparing...########################################### [100%]
package gcc-c++-4.1.2-48.el5.x86_64(which is newer than gcc-c++-4.1.2-46.el5.x86_64)is already installed
file /usr/bin/c++ from install of gcc-c++-4.1.2-46.el5.x86_64 conflicts with file from package gcc-c++-4.1.2-48.el5.x86_64
file /usr/bin/g++ from install of gcc-c++-4.1.2-46.el5.x86_64 conflicts with file from package gcc-c++-4.1.2-48.el5.x86_64
file /usr/bin/x86_64-redhat-linux-c++ from install of gcc-c++-4.1.2-46.el5.x86_64 conflicts with file from package gcc-c++-4.1.2-48.el5.x86_64
file /usr/bin/x86_64-redhat-linux-g++ from install of gcc-c++-4.1.2-46.el5.x86_64 conflicts with file from package gcc-c++-4.1.2-48.el5.x86_64
file /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libsupc++.a from install of gcc-c++-4.1.2-46.el5.x86_64 conflicts with file from package gcc-c++-4.1.2-48.el5.x86_64
file /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libsupc++.a from install of gcc-c++-4.1.2-46.el5.x86_64 conflicts with file from package gcc-c++-4.1.2-48.el5.x86_64
file /usr/libexec/gcc/x86_64-redhat-linux/4.1.1/cc1plus from install of gcc-c++-4.1.2-46.el5.x86_64 conflicts with file from package gcc-c++-4.1.2-48.el5.x86_64
file /usr/share/man/man1/g++.1.gz from install of gcc-c++-4.1.2-46.el5.x86_64 conflicts with file from package gcc-c++-4.1.2-48.el5.x86_64