configure: error: C++ compiler cannot create executables
This kind of error generally comes when you are installing the package from source code. The source code have many C or C++ files which require C compiler.
To solve this issue in CentOS and Red Hat ,run the below given command.
Here we are using wildcard * to install all the package name which has gcc-c++ name in between of their names
yum install gc gcc++ *gcc-c++*