Centos上运行g++c++:command not found
[root@localhost bin]# g++
-bash: g++: command not found
[root@localhost bin]# whereis g++
g++:
[root@localhost bin]# whereis c++
c++:
[root@localhost bin]#
[root@localhost bin]#
[root@localhost bin]# g++
-bash: g++: command not found
[root@localhost bin]# yum install gcc gcc-c++
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirrors.skyshe.cn
Setting up Install Process
Package gcc-4.4.7-11.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.x86_64 0:4.4.7-11.el6 will be installed
--> Processing Dependency: libstdc++-devel = 4.4.7-11.el6 for package: gcc-c++-4.4.7-11.el6.x86_64
--> Processing Dependency: libstdc++ = 4.4.7-11.el6 for package: gcc-c++-4.4.7-11.el6.x86_64
--> Running transaction check
---> Package libstdc++.x86_64 0:4.4.7-4.el6 will be updated
---> Package libstdc++.x86_64 0:4.4.7-11.el6 will be an update
---> Package libstdc++-devel.x86_64 0:4.4.7-11.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================
Package Arch Version Repository Size
==============================================================================================
Installing:
gcc-c++ x86_64 4.4.7-11.el6 base 4.7 M
Installing for dependencies:
libstdc++-devel x86_64 4.4.7-11.el6 base 1.6 M
Updating for dependencies:
libstdc++ x86_64 4.4.7-11.el6 base 294 k
Transaction Summary
==============================================================================================
Install 2 Package(s)
Upgrade 1 Package(s)
Total download size: 6.6 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): gcc-c++-4.4.7-11.el6.x86_64.rpm | 4.7 MB 00:13
(2/3): libstdc++-4.4.7-11.el6.x86_64.rpm | 294 kB 00:00
(3/3): libstdc++-devel-4.4.7-11.el6.x86_64.rpm | 1.6 MB 00:04
----------------------------------------------------------------------------------------------
Total 340 kB/s | 6.6 MB 00:19
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : libstdc++-4.4.7-11.el6.x86_64 1/4
Installing : libstdc++-devel-4.4.7-11.el6.x86_64 2/4
Installing : gcc-c++-4.4.7-11.el6.x86_64 3/4
Cleanup : libstdc++-4.4.7-4.el6.x86_64 4/4
Verifying : libstdc++-devel-4.4.7-11.el6.x86_64 1/4
Verifying : libstdc++-4.4.7-11.el6.x86_64 2/4
Verifying : gcc-c++-4.4.7-11.el6.x86_64 3/4
Verifying : libstdc++-4.4.7-4.el6.x86_64 4/4
Installed:
gcc-c++.x86_64 0:4.4.7-11.el6
Dependency Installed:
libstdc++-devel.x86_64 0:4.4.7-11.el6
Dependency Updated:
libstdc++.x86_64 0:4.4.7-11.el6
Complete!
[root@localhost bin]# g++
g++: no input files
[root@localhost bin]#