[root@www ~]# yum install gcc*
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Package gcc-4.4.4-13.el6.x86_64 already installed and latest version
Package gcc-java-4.4.4-13.el6.x86_64 already installed and latest version
Package gcc-c++-4.4.4-13.el6.x86_64 already installed and latest version
Resolving Dependencies
–> Running transaction check
—> Package gcc-gfortran.x86_64 0:4.4.4-13.el6 set to be updated
—> Package gcc-gnat.x86_64 0:4.4.4-13.el6 set to be updated
–> Processing Dependency: libgnat = 4.4.4-13.el6 for package: gcc-gnat-4.4.4-13.el6.x86_64
–> Processing Dependency: libgnat-devel = 4.4.4-13.el6 for package: gcc-gnat-4.4.4-13.el6.x86_64
—> Package gcc-objc.x86_64 0:4.4.4-13.el6 set to be updated
–> Processing Dependency: libobjc = 4.4.4-13.el6 for package: gcc-objc-4.4.4-13.el6.x86_64
–> Processing Dependency: libobjc.so.2()(64bit) for package: gcc-objc-4.4.4-13.el6.x86_64
—> Package gcc-objc++.x86_64 0:4.4.4-13.el6 set to be updated
–> Running transaction check
—> Package libgnat.x86_64 0:4.4.4-13.el6 set to be updated
—> Package libgnat-devel.x86_64 0:4.4.4-13.el6 set to be updated
—> Package libobjc.x86_64 0:4.4.4-13.el6 set to be updated
–> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
gcc-gfortran x86_64 4.4.4-13.el6 server 4.7 M
gcc-gnat x86_64 4.4.4-13.el6 server 8.7 M
gcc-objc x86_64 4.4.4-13.el6 server 3.6 M
gcc-objc++ x86_64 4.4.4-13.el6 server 4.0 M
Installing for dependencies:
libgnat x86_64 4.4.4-13.el6 server 902 k
libgnat-devel x86_64 4.4.4-13.el6 server 3.2 M
libobjc x86_64 4.4.4-13.el6 server 81 k
Transaction Summary
====================================================================================================
Install 7 Package(s)
Upgrade 0 Package(s)
Total download size: 25 M
Installed size: 79 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): gcc-gfortran-4.4.4-13.el6.x86_64.rpm | 4.7 MB 00:00
(2/7): gcc-gnat-4.4.4-13.el6.x86_64.rpm | 8.7 MB 00:00
(3/7): gcc-objc-4.4.4-13.el6.x86_64.rpm | 3.6 MB 00:00
(4/7): gcc-objc++-4.4.4-13.el6.x86_64.rpm | 4.0 MB 00:00
(5/7): libgnat-4.4.4-13.el6.x86_64.rpm | 902 kB 00:00
(6/7): libgnat-devel-4.4.4-13.el6.x86_64.rpm | 3.2 MB 00:00
(7/7): libobjc-4.4.4-13.el6.x86_64.rpm | 81 kB 00:00
—————————————————————————————————-
Total 31 MB/s | 25 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libgnat-4.4.4-13.el6.x86_64 1/7
Installing : libobjc-4.4.4-13.el6.x86_64 2/7
Installing : gcc-objc-4.4.4-13.el6.x86_64 3/7
Installing : gcc-objc++-4.4.4-13.el6.x86_64 4/7
Installing : gcc-gfortran-4.4.4-13.el6.x86_64 5/7
Installing : libgnat-devel-4.4.4-13.el6.x86_64 6/7
Installing : gcc-gnat-4.4.4-13.el6.x86_64 7/7
Installed:
gcc-gfortran.x86_64 0:4.4.4-13.el6 gcc-gnat.x86_64 0:4.4.4-13.el6 gcc-objc.x86_64 0:4.4.4-13.el6
gcc-objc++.x86_64 0:4.4.4-13.el6
Dependency Installed:
libgnat.x86_64 0:4.4.4-13.el6 libgnat-devel.x86_64 0:4.4.4-13.el6 libobjc.x86_64 0:4.4.4-13.el6
Complete!
[root@www]# cd Desktop
[root@www Desktop]# mkdir c++
[root@www Desktop]# cd c++
[root@www c++]# vim hello.cpp
[root@www c++]# ls
hello.cpp
[root@www c++]# g++ hello.cpp
(compilation with the help of g++ and .cpp is the extension of C++ programs)
[root@www c++]# ls
a.out hello.cpp
(a.out is a executable file)
[root@www c++]# ./a.out
Hello World!




