checkingforC++compilerdefaultoutput...configure:error:C++compilercannotcreateexecutable
今天编译一个C++程序遇到问题如下:
checkingforaBSD-compatibleinstall.../usr/bin/install-c
checkingwhetherbuildenvironmentissane...yes
checkingforgawk...gawk
checkingwhethermakesets${MAKE}...yes
checkingforg++...no
checkingforc++...no
checkingforgpp...no
checkingforaCC...no
checkingforCC...no
checkingforcxx...no
checkingforcc++...no
checkingforcl...no
checkingforFCC...no
checkingforKCC...no
checkingforRCC...no
checkingforxlC_r...no
checkingforxlC...no
checkingforC++compilerdefaultoutput...configure:error:C++compilercannotcreateexecutable
检查config.log,发现错误如下
g++:commandnotfound
于是,通过yumlist命令查找g++的包:
[root@localhosttahoe]#yumlist|grepc++
libstdc++.i3864.1.2-51.el5installed
ImageMagick-c++.i3866.2.8.0-15.el5_8base
ImageMagick-c++-devel.i3866.2.8.0-15.el5_8base
compat-gcc-34-c++.i3863.4.6-4.1base
compat-libstdc++-296.i3862.96-138base
compat-libstdc++-33.i3863.2.3-61base
gcc-c++.i3864.1.2-54.el5base
gcc-objc++.i3864.1.2-54.el5base
gcc44-c++.i3864.4.7-1.el5base
libstdc++.i3864.1.2-54.el5base
libstdc++-devel.i3864.1.2-54.el5base
libstdc++44-devel.i3864.4.7-1.el5base
xmlrpc-c-c++.i3861.16.24-1206.1840.4.el5base
通过yum命令安装
[root@localhost]#yuminstallgcc-c++.i386
Loadedplugins:fastestmirror
Loadingmirrorspeedsfromcachedhostfile
*base:mirror.usonyx.net
*extras:mirror.usonyx.net
*updates:ftp.swin.edu.au
SettingupInstallProcess
ResolvingDependencies
-->Runningtransactioncheck
--->Packagegcc-c++.i3860:4.1.2-54.el5settobeupdated
-->ProcessingDependency:libstdc++=4.1.2-54.el5forpackage:gcc-c++
-->ProcessingDependency:libstdc++-devel=4.1.2-54.el5forpackage:gcc-c++
-->Runningtransactioncheck
--->Packagelibstdc++.i3860:4.1.2-54.el5settobeupdated
--->Packagelibstdc++-devel.i3860:4.1.2-54.el5settobeupdated
updates/filelists_db|688kB00:00
http://ftp.swin.edu.au/centos/5.9/updates/i386/repodata/filelists.sqlite.bz2:[Errno-1]Metadatafiledoesnotmatchchecksum
Tryingothermirror.
updates/filelists_db|688kB00:00
http://mirror.colocity.com/centos/5.9/updates/i386/repodata/filelists.sqlite.bz2:[Errno-1]Metadatafiledoesnotmatchchecksum
Tryingothermirror.
updates/filelists_db|688kB00:00
http://mirror.usonyx.net/Linux/CentOS/5.9/updates/i386/repodata/filelists.sqlite.bz2:[Errno-1]Metadatafiledoesnotmatchchecksum
Tryingothermirror.
updates/filelists_db|688kB00:00
http://centos.biz.net.id/5.9/updates/i386/repodata/filelists.sqlite.bz2:[Errno-1]Metadatafiledoesnotmatchchecksum
Tryingothermirror.
updates/filelists_db|688kB00:00
http://centos.ipserverone.com/centos/5.9/updates/i386/repodata/filelists.sqlite.bz2:[Errno-1]Metadatafiledoesnotmatchchecksum
Tryingothermirror.
updates/filelists_db|688kB00:00
http://kartolo.sby.datautama.net.id/Centos/5.9/updates/i386/repodata/filelists.sqlite.bz2:[Errno-1]Metadatafiledoesnotmatchchecksum
Tryingothermirror.
updates/filelists_db|688kB00:00
http://mirror.nus.edu.sg/centos/5.9/updates/i386/repodata/filelists.sqlite.bz2:[Errno-1]Metadatafiledoesnotmatchchecksum
Tryingothermirror.
updates/filelists_db|688kB00:00
http://ossm.utm.my/centos/5.9/updates/i386/repodata/filelists.sqlite.bz2:[Errno-1]Metadatafiledoesnotmatchchecksum
Tryingothermirror.
updates/filelists_db|688kB00:00
http://mirror.ventraip.net.au/CentOS/5.9/updates/i386/repodata/filelists.sqlite.bz2:[Errno-1]Metadatafiledoesnotmatchchecksum
Tryingothermirror.
updates/filelists_db|688kB00:00
http://mirrors.hostemo.com/CentOS/5.9/updates/i386/repodata/filelists.sqlite.bz2:[Errno-1]Metadatafiledoesnotmatchchecksum
Tryingothermirror.
Error:failure:repodata/filelists.sqlite.bz2fromupdates:[Errno256]Nomoremirrorstotry.
Youcouldtryusing--skip-brokentoworkaroundtheproblem
Youcouldtryrunning:package-cleanup--problems
package-cleanup--dupes
rpm-Va--nofiles--nodigest
Theprogrampackage-cleanupisfoundintheyum-utilspackage.
居然找不到镜像去安装。
于是继续调查,发现可以通过su-c'yumcleanall'将yum默认的镜像清除,然后,再通过命令yuminstallgcc-c++.i386安装。
终于按装成功。
转载于:https://blog.51cto.com/lyz123/1328285