g++ under CentOS: Command not found problem resolutionFebruary 27, 2017 18:09:06 read: 5174 Tags: centosgcc more Personal classification: Problem AnalysisCopyright NOTICE: This article is the author's hard writing results, if need to reprint, please contact the author, and retain the author information and the original link, thank you ~ ~ 58173190
1. The question was raised
During the installation of Extundelete, it was found that during the configure process, there was an error, and the specific error message was as follows:
- configure:2865:g++--version >&5
- ./configure:line 2867:g++: Command not found
- configure:2876: $? = 127
- configure:2865:g++-V >&5
- ./configure:line 2867:g++: Command not found
- configure:2876: $? = 127
- configure:2865:g++-V >&5
- ./configure:line 2867:g++: Command not found
- configure:2876: $? = 127
- configure:2865:g++-qversion >&5
- ./configure:line 2867:g++: Command not found
- configure:2876: $? = 127
- Configure:2896:checking whether the C + + compiler works
- configure:2918:g++ Conftest.cpp >&5
- ./configure:line 2920:g++: Command not found
- configure:2922: $? = 127
- Configure:2960:result:no
- Configure:failed program was:
- | /* Confdefs.h */
- | #define PACKAGE_NAME "Extundelete"
- | #define PACKAGE_TARNAME "Extundelete"
- | #define Package_version "0.2.4"
- | #define Package_string "Extundelete 0.2.4"
- | #define Package_bugreport "Extundelete.sourceforge.net"
- | #define PACKAGE_URL ""
- | #define PACKAGE "Extundelete"
- | #define VERSION "0.2.4"
- | /* End confdefs.h. */
- |
- | Int
- | Main ()
- | {
- |
- | ;
- | return 0;
- | }
- Configure:2965:error:in '/root/extundelete-0.2.4 ':
- configure:2967:error:c++ compiler cannot create executables
- See ' Config.log ' for more details
After analysis, it is found that the key error messages are:
g++: command not found
g++ immediately to the brain to complement the gc++ compiler is not installed AH? Estimate yes, retrace, install look.
2. Installation and resolution
Because I am using the OS environment for CentOS, the default package management tool is Yum, so follow the dependency package:
- YUM-Y Update gcc
- Yum-y Install gcc+ gcc-c++
After executing the above command, you can return to the GCC related commands in accordance with the success, so the problem is resolved.
3. Summary analysis
By default, CentOS does not follow the GCC-related compilation commands, and if, at the time of installing the software, it is sometimes necessary to install it from source code compilation, then GCC command support is required.
"Pro-Test" <g++/gcc>centos under g++: Command not found problem Resolution (C + + environment installation)